Skip to content

Commit 2b93452

Browse files
committed
Merge pull request #255 from eslint/issue254
Fix: exponentiation operator token (fixes #254)
2 parents 922562a + 3614e81 commit 2b93452

16 files changed

+20
-58
lines changed

lib/token-translator.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ TokenTranslator.prototype = {
142142
type === tt.colon || type === tt.question ||
143143
type === tt.bracketR || type === tt.ellipsis ||
144144
type === tt.arrow || type === tt.jsxTagStart ||
145+
type === tt.incDec || type === tt.starstar ||
145146
type === tt.jsxTagEnd || (type.binop && !type.keyword) ||
146147
type.isAssign) {
147148

tests/fixtures/ecma-version/7/exponential-plusplus.result.js

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,7 @@ module.exports = {
128128
]
129129
},
130130
{
131-
"type": {
132-
"label": "++/--",
133-
"beforeExpr": false,
134-
"startsExpr": true,
135-
"isLoop": false,
136-
"isAssign": false,
137-
"prefix": true,
138-
"postfix": true,
139-
"binop": null
140-
},
131+
"type": "Punctuator",
141132
"value": "++",
142133
"loc": {
143134
"start": {
@@ -155,17 +146,7 @@ module.exports = {
155146
]
156147
},
157148
{
158-
"type": {
159-
"label": "**",
160-
"beforeExpr": true,
161-
"startsExpr": false,
162-
"isLoop": false,
163-
"isAssign": false,
164-
"prefix": false,
165-
"postfix": false,
166-
"binop": null,
167-
"updateContext": null
168-
},
149+
"type": "Punctuator",
169150
"value": "**",
170151
"loc": {
171152
"start": {
@@ -219,4 +200,4 @@ module.exports = {
219200
]
220201
}
221202
]
222-
};
203+
};

tests/fixtures/ecma-version/7/exponential-precedence.result.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,7 @@ module.exports = {
183183
]
184184
},
185185
{
186-
"type": {
187-
"label": "**",
188-
"beforeExpr": true,
189-
"startsExpr": false,
190-
"isLoop": false,
191-
"isAssign": false,
192-
"prefix": false,
193-
"postfix": false,
194-
"binop": null,
195-
"updateContext": null
196-
},
186+
"type": "Punctuator",
197187
"value": "**",
198188
"loc": {
199189
"start": {
@@ -247,4 +237,4 @@ module.exports = {
247237
]
248238
}
249239
]
250-
};
240+
};

tests/fixtures/ecma-version/7/exponential-simple.result.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,7 @@ module.exports = {
110110
]
111111
},
112112
{
113-
"type": {
114-
"label": "**",
115-
"beforeExpr": true,
116-
"startsExpr": false,
117-
"isLoop": false,
118-
"isAssign": false,
119-
"prefix": false,
120-
"postfix": false,
121-
"binop": null,
122-
"updateContext": null
123-
},
113+
"type": "Punctuator",
124114
"value": "**",
125115
"loc": {
126116
"start": {
@@ -174,4 +164,4 @@ module.exports = {
174164
]
175165
}
176166
]
177-
};
167+
};

tests/fixtures/libraries/XMLHttpRequest.js.result.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tests/fixtures/libraries/angular-1.2.5.js.result.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tests/fixtures/libraries/backbone-1.1.0.js.result.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tests/fixtures/libraries/benchmark.js.result.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tests/fixtures/libraries/escodegen.browser.js.result.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tests/fixtures/libraries/escope.js.result.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tests/fixtures/libraries/esmangle.browser.js.result.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tests/fixtures/libraries/esrefactor.js.result.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tests/fixtures/libraries/jquery-1.9.1.js.result.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tests/fixtures/libraries/mootools-1.4.5.js.result.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tests/fixtures/libraries/underscore-1.5.2.js.result.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tests/fixtures/libraries/yui-3.12.0.js.result.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)