[Pkg-javascript-commits] [node-acorn-jsx] 209/484: Fixed testFail messages for character escape sequences.

Bastien Roucariès rouca at moszumanska.debian.org
Sat Aug 19 14:20:29 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-acorn-jsx.

commit a5cf393134a77d907886d5dc8aa6f2859c3f4cb2
Author: Ingvar Stepanyan <me at rreverser.com>
Date:   Thu Jul 24 03:07:53 2014 +0300

    Fixed testFail messages for character escape sequences.
---
 acorn.js              | 6 +++---
 test/tests-harmony.js | 8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/acorn.js b/acorn.js
index 556ab0e..9c08ae9 100644
--- a/acorn.js
+++ b/acorn.js
@@ -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);
     }
diff --git a/test/tests-harmony.js b/test/tests-harmony.js
index 95905f1..cbab6dc 100644
--- a/test/tests-harmony.js
+++ b/test/tests-harmony.js
@@ -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});
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-acorn-jsx.git



More information about the Pkg-javascript-commits mailing list