You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41-41Lines changed: 41 additions & 41 deletions
Original file line number
Diff line number
Diff line change
@@ -4,29 +4,29 @@ utility box for ECMAScript language tools.
4
4
5
5
### API
6
6
7
-
### ast
7
+
### `ast`
8
8
9
-
#### ast.isExpression(node)
9
+
#### `ast.isExpression(node)`
10
10
11
-
Returns true if `node` is an Expression as defined in ECMA262 edition 5.1 section
11
+
Returns `true` if `node` is an Expression as defined in ECMA262 edition 5.1 section
12
12
[11](https://es5.github.io/#x11).
13
13
14
-
#### ast.isStatement(node)
14
+
#### `ast.isStatement(node)`
15
15
16
-
Returns true if `node` is a Statement as defined in ECMA262 edition 5.1 section
16
+
Returns `true` if `node` is a Statement as defined in ECMA262 edition 5.1 section
17
17
[12](https://es5.github.io/#x12).
18
18
19
-
#### ast.isIterationStatement(node)
19
+
#### `ast.isIterationStatement(node)`
20
20
21
-
Returns true if `node` is an IterationStatement as defined in ECMA262 edition
21
+
Returns `true` if `node` is an IterationStatement as defined in ECMA262 edition
22
22
5.1 section [12.6](https://es5.github.io/#x12.6).
23
23
24
-
#### ast.isSourceElement(node)
24
+
#### `ast.isSourceElement(node)`
25
25
26
-
Returns true if `node` is a SourceElement as defined in ECMA262 edition 5.1
26
+
Returns `true` if `node` is a SourceElement as defined in ECMA262 edition 5.1
27
27
section [14](https://es5.github.io/#x14).
28
28
29
-
#### ast.trailingStatement(node)
29
+
#### `ast.trailingStatement(node)`
30
30
31
31
Returns `Statement?` if `node` has trailing `Statement`.
32
32
```js
@@ -35,9 +35,9 @@ if (cond)
35
35
```
36
36
When taking this `IfStatement`, returns `consequent;` statement.
37
37
38
-
#### ast.isProblematicIfStatement(node)
38
+
#### `ast.isProblematicIfStatement(node)`
39
39
40
-
Returns true if `node` is a problematic IfStatement. If `node` is a problematic `IfStatement`, `node` cannot be represented as an one on one JavaScript code.
40
+
Returns `true` if `node` is a problematic IfStatement. If `node` is a problematic `IfStatement`, `node` cannot be represented as an one on one JavaScript code.
41
41
```js
42
42
{
43
43
type:'IfStatement',
@@ -54,47 +54,47 @@ Returns true if `node` is a problematic IfStatement. If `node` is a problematic
54
54
The above node cannot be represented as a JavaScript code, since the top level `else` alternate belongs to an inner `IfStatement`.
55
55
56
56
57
-
### code
57
+
### `code`
58
58
59
-
#### code.isDecimalDigit(code)
59
+
#### `code.isDecimalDigit(code)`
60
60
61
-
Return true if provided code is decimal digit.
61
+
Return `true` if provided code is decimal digit.
62
62
63
-
#### code.isHexDigit(code)
63
+
#### `code.isHexDigit(code)`
64
64
65
-
Return true if provided code is hexadecimal digit.
65
+
Return `true` if provided code is hexadecimal digit.
66
66
67
-
#### code.isOctalDigit(code)
67
+
#### `code.isOctalDigit(code)`
68
68
69
-
Return true if provided code is octal digit.
69
+
Return `true` if provided code is octal digit.
70
70
71
-
#### code.isWhiteSpace(code)
71
+
#### `code.isWhiteSpace(code)`
72
72
73
-
Return true if provided code is white space. White space characters are formally defined in ECMA262.
73
+
Return `true` if provided code is white space. White space characters are formally defined in ECMA262.
74
74
75
-
#### code.isLineTerminator(code)
75
+
#### `code.isLineTerminator(code)`
76
76
77
-
Return true if provided code is line terminator. Line terminator characters are formally defined in ECMA262.
77
+
Return `true` if provided code is line terminator. Line terminator characters are formally defined in ECMA262.
78
78
79
-
#### code.isIdentifierStart(code)
79
+
#### `code.isIdentifierStart(code)`
80
80
81
-
Return true if provided code can be the first character of ECMA262 Identifier. They are formally defined in ECMA262.
81
+
Return `true` if provided code can be the first character of ECMA262 Identifier. They are formally defined in ECMA262.
82
82
83
-
#### code.isIdentifierPart(code)
83
+
#### `code.isIdentifierPart(code)`
84
84
85
-
Return true if provided code can be the trailing character of ECMA262 Identifier. They are formally defined in ECMA262.
85
+
Return `true` if provided code can be the trailing character of ECMA262 Identifier. They are formally defined in ECMA262.
86
86
87
-
### keyword
87
+
### `keyword`
88
88
89
-
#### keyword.isKeywordES5(id, strict)
89
+
#### `keyword.isKeywordES5(id, strict)`
90
90
91
91
Returns `true` if provided identifier string is a Keyword or Future Reserved Word
92
92
in ECMA262 edition 5.1. They are formally defined in ECMA262 sections
93
93
[7.6.1.1](http://es5.github.io/#x7.6.1.1) and [7.6.1.2](http://es5.github.io/#x7.6.1.2),
94
94
respectively. If the `strict` flag is truthy, this function additionally checks whether
95
95
`id` is a Keyword or Future Reserved Word under strict mode.
96
96
97
-
#### keyword.isKeywordES6(id, strict)
97
+
#### `keyword.isKeywordES6(id, strict)`
98
98
99
99
Returns `true` if provided identifier string is a Keyword or Future Reserved Word
100
100
in ECMA262 edition 6. They are formally defined in ECMA262 sections
@@ -103,46 +103,46 @@ in ECMA262 edition 6. They are formally defined in ECMA262 sections
103
103
respectively. If the `strict` flag is truthy, this function additionally checks whether
104
104
`id` is a Keyword or Future Reserved Word under strict mode.
105
105
106
-
#### keyword.isReservedWordES5(id, strict)
106
+
#### `keyword.isReservedWordES5(id, strict)`
107
107
108
108
Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 5.1.
109
109
They are formally defined in ECMA262 section [7.6.1](http://es5.github.io/#x7.6.1).
110
110
If the `strict` flag is truthy, this function additionally checks whether `id`
111
111
is a Reserved Word under strict mode.
112
112
113
-
#### keyword.isReservedWordES6(id, strict)
113
+
#### `keyword.isReservedWordES6(id, strict)`
114
114
115
115
Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 6.
116
116
They are formally defined in ECMA262 section [11.6.2](http://ecma-international.org/ecma-262/6.0/#sec-reserved-words).
117
117
If the `strict` flag is truthy, this function additionally checks whether `id`
118
118
is a Reserved Word under strict mode.
119
119
120
-
#### keyword.isRestrictedWord(id)
120
+
#### `keyword.isRestrictedWord(id)`
121
121
122
122
Returns `true` if provided identifier string is one of `eval` or `arguments`.
123
123
They are restricted in strict mode code throughout ECMA262 edition 5.1 and
124
124
in ECMA262 edition 6 section [12.1.1](http://ecma-international.org/ecma-262/6.0/#sec-identifiers-static-semantics-early-errors).
125
125
126
-
#### keyword.isIdentifierNameES5(id)
126
+
#### `keyword.isIdentifierNameES5(id)`
127
127
128
-
Return true if provided identifier string is an IdentifierName as specified in
128
+
Return `true` if provided identifier string is an IdentifierName as specified in
0 commit comments