Fix incorrect parsing of %* (#624)

This commit is contained in:
Brian Ng 2017-07-13 15:04:05 -05:00 committed by GitHub
parent f2b8d1f179
commit 63143ea5e9
5 changed files with 10 additions and 2 deletions

View File

@ -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;

View File

@ -0,0 +1 @@
1 %* 1;

View File

@ -0,0 +1,3 @@
{
"throws": "Unexpected token (1:3)"
}

View File

@ -0,0 +1 @@
a %*= 1;

View File

@ -0,0 +1,3 @@
{
"throws": "Unexpected token (1:3)"
}