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
* Be consistent with applying backtick (`…`) formatting to formally defined `TokenNames`.
* Add a few linebreaks after repetitive sections (“formally defined in…”, and “If `strict` flag is true…”) to make things easier when reading as plain-text markdown.
* Reduce all heading levels by 1 (and make the first heading an `h1`).
esutils ([esutils](http://github.com/estools/esutils)) is
3
3
utility box for ECMAScript language tools.
4
4
5
-
###API
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-to-one JavaScript code.
41
41
```js
42
42
{
43
43
type:'IfStatement',
@@ -54,100 +54,108 @@ Returns `true` if `node` is a problematic IfStatement. If `node` is a problemati
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
61
Return `true` if provided code is decimal digit.
62
62
63
-
####`code.isHexDigit(code)`
63
+
### `code.isHexDigit(code)`
64
64
65
65
Return `true` if provided code is hexadecimal digit.
66
66
67
-
####`code.isOctalDigit(code)`
67
+
### `code.isOctalDigit(code)`
68
68
69
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.
74
+
White space characters are formally defined in ECMA262.
74
75
75
-
####`code.isLineTerminator(code)`
76
+
### `code.isLineTerminator(code)`
76
77
77
-
Return `true` if provided code is line terminator. Line terminator characters are formally defined in ECMA262.
78
+
Return `true` if provided code is line terminator.
79
+
Line terminator characters are formally defined in ECMA262.
78
80
79
-
####`code.isIdentifierStart(code)`
81
+
### `code.isIdentifierStart(code)`
80
82
81
-
Return `true` if provided code can be the first character of ECMA262 Identifier. They are formally defined in ECMA262.
83
+
Return `true` if provided code can be the first character of ECMA262 `Identifier`.
84
+
They are formally defined in ECMA262.
82
85
83
-
####`code.isIdentifierPart(code)`
86
+
### `code.isIdentifierPart(code)`
84
87
85
-
Return `true` if provided code can be the trailing character of ECMA262 Identifier. They are formally defined in ECMA262.
88
+
Return `true` if provided code can be the trailing character of ECMA262 `Identifier`.
89
+
They are formally defined in ECMA262.
86
90
87
-
###`keyword`
91
+
## `keyword`
88
92
89
-
####`keyword.isKeywordES5(id, strict)`
93
+
### `keyword.isKeywordES5(id, strict)`
90
94
91
95
Returns `true` if provided identifier string is a Keyword or Future Reserved Word
92
-
in ECMA262 edition 5.1. They are formally defined in ECMA262 sections
96
+
in ECMA262 edition 5.1.
97
+
They are formally defined in ECMA262 sections
93
98
[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
-
respectively. If the `strict` flag is truthy, this function additionally checks whether
95
-
`id` is a Keyword or Future Reserved Word under strict mode.
99
+
respectively.
100
+
If the `strict` flag is truthy, this function additionally checks whether
101
+
`id` is a `Keyword` or `FutureReservedWord` under strict mode.
96
102
97
-
####`keyword.isKeywordES6(id, strict)`
103
+
### `keyword.isKeywordES6(id, strict)`
98
104
99
-
Returns `true` if provided identifier string is a Keyword or Future Reserved Word
100
-
in ECMA262 edition 6. They are formally defined in ECMA262 sections
105
+
Returns `true` if provided identifier string is a `Keyword` or `FutureReservedWord`
106
+
in ECMA262 edition 6.
107
+
They are formally defined in ECMA262 sections
101
108
[11.6.2.1](http://ecma-international.org/ecma-262/6.0/#sec-keywords) and
0 commit comments