Skip to content

Commit

Permalink
Fixed testFail messages for character escape sequences.
Browse files Browse the repository at this point in the history
  • Loading branch information
RReverser authored and marijnh committed Jul 29, 2014
1 parent 2db14fb commit a5cf393
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions acorn.js
Original file line number Diff line number Diff line change
Expand Up @@ -872,9 +872,9 @@
if (ch === 123) {
if (options.ecmaVersion < 6) unexpected();
++tokPos;
code = readHexChar();
ch = input.charCodeAt(tokPos++);
if (code > 0x10FFFF || ch !== 125 /* '}' */) unexpected();
code = readHexChar(input.indexOf('}', tokPos) - tokPos);
++tokPos;
if (code > 0x10FFFF) unexpected();
} else {
code = readHexChar(4);
}
Expand Down
8 changes: 4 additions & 4 deletions test/tests-harmony.js
Original file line number Diff line number Diff line change
Expand Up @@ -15751,13 +15751,13 @@ testFail("0B18", "Unexpected token (1:3)", {ecmaVersion: 6});

testFail("0B12", "Unexpected token (1:3)", {ecmaVersion: 6});

testFail("\"\\u{110000}\"", "Unexpected token (1:12)", {ecmaVersion: 6});
testFail("\"\\u{110000}\"", "Unexpected token (1:0)", {ecmaVersion: 6});

testFail("\"\\u{}\"", "Unexpected token (1:5)", {ecmaVersion: 6});
testFail("\"\\u{}\"", "Bad character escape sequence (1:0)", {ecmaVersion: 6});

testFail("\"\\u{FFFF\"", "Unexpected token (1:10)", {ecmaVersion: 6});
testFail("\"\\u{FFFF\"", "Bad character escape sequence (1:0)", {ecmaVersion: 6});

testFail("\"\\u{FFZ}\"", "Unexpected token (1:8)", {ecmaVersion: 6});
testFail("\"\\u{FFZ}\"", "Bad character escape sequence (1:0)", {ecmaVersion: 6});

testFail("[v] += ary", "Unexpected token (1:4)", {ecmaVersion: 6});

Expand Down

0 comments on commit a5cf393

Please sign in to comment.