nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTree.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
26 package jdk.nashorn.api.tree; |
26 package jdk.nashorn.api.tree; |
27 |
27 |
28 import java.util.List; |
28 import java.util.List; |
29 |
29 |
30 /** |
30 /** |
31 * A tree node for a function declaration. |
31 * A tree node for a <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-function-definitions">function declaration</a>. |
32 * |
32 * |
33 * For example: |
33 * For example: |
34 * <pre> |
34 * <pre> |
35 * <em>function</em> <em>name</em> |
35 * <em>function</em> <em>name</em> |
|
36 * ( <em>parameters</em> ) |
|
37 * <em>body</em> |
|
38 * </pre> |
|
39 * |
|
40 * <pre> |
|
41 * <em>function*</em> <em>name</em> |
36 * ( <em>parameters</em> ) |
42 * ( <em>parameters</em> ) |
37 * <em>body</em> |
43 * <em>body</em> |
38 * </pre> |
44 * </pre> |
39 * |
45 * |
40 * @since 9 |
46 * @since 9 |
43 /** |
49 /** |
44 * Returns the name of the function being declared. |
50 * Returns the name of the function being declared. |
45 * |
51 * |
46 * @return name the function declared |
52 * @return name the function declared |
47 */ |
53 */ |
48 String getName(); |
54 IdentifierTree getName(); |
49 |
55 |
50 /** |
56 /** |
51 * Returns the parameters of this function. |
57 * Returns the parameters of this function. |
52 * |
58 * |
53 * @return the list of parameters |
59 * @return the list of parameters |
65 * Is this a strict function? |
71 * Is this a strict function? |
66 * |
72 * |
67 * @return true if this function is strict |
73 * @return true if this function is strict |
68 */ |
74 */ |
69 boolean isStrict(); |
75 boolean isStrict(); |
|
76 |
|
77 /** |
|
78 * Is this a generator function? |
|
79 * |
|
80 * @return true if this is a generator function |
|
81 */ |
|
82 boolean isGenerator(); |
70 } |
83 } |