Fix incorrect parsing of %* (#624)
This commit is contained in:
parent
f2b8d1f179
commit
63143ea5e9
@ -391,8 +391,8 @@ export default class Tokenizer extends LocationParser {
|
||||
let width = 1;
|
||||
let next = this.input.charCodeAt(this.state.pos + 1);
|
||||
|
||||
if (next === 42) {
|
||||
// '*'
|
||||
// Exponentiation operator **
|
||||
if (code === 42 && next === 42) {
|
||||
width++;
|
||||
next = this.input.charCodeAt(this.state.pos + 2);
|
||||
type = tt.exponent;
|
||||
|
||||
1
test/fixtures/es2016/exponentiation-operator/13/actual.js
vendored
Normal file
1
test/fixtures/es2016/exponentiation-operator/13/actual.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
1 %* 1;
|
||||
3
test/fixtures/es2016/exponentiation-operator/13/options.json
vendored
Normal file
3
test/fixtures/es2016/exponentiation-operator/13/options.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "Unexpected token (1:3)"
|
||||
}
|
||||
1
test/fixtures/es2016/exponentiation-operator/14/actual.js
vendored
Normal file
1
test/fixtures/es2016/exponentiation-operator/14/actual.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
a %*= 1;
|
||||
3
test/fixtures/es2016/exponentiation-operator/14/options.json
vendored
Normal file
3
test/fixtures/es2016/exponentiation-operator/14/options.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "Unexpected token (1:3)"
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user