From fac166703becc1959e019e2fc9b3c1d86fb167c5 Mon Sep 17 00:00:00 2001 From: alexlamsl Date: Mon, 24 Jul 2017 00:11:27 +0800 Subject: [PATCH] enhance test for #2242 --- test/mocha/unicode.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/mocha/unicode.js b/test/mocha/unicode.js index e5d94836..a89b5031 100644 --- a/test/mocha/unicode.js +++ b/test/mocha/unicode.js @@ -147,7 +147,7 @@ describe("Unicode", function() { if (semver.satisfies(process.version, ">=4")) { it("Should not unescape unpaired surrogates", function() { var code = []; - for (var i = 0; i <= 0xFFFF; i++) { + for (var i = 0; i <= 0x20001; i++) { code.push("\\u{" + i.toString(16) + "}"); } code = '"' + code.join() + '"'; @@ -162,7 +162,7 @@ describe("Unicode", function() { ecma: ecma }); if (result.error) throw result.error; - assert.ok(code.length > result.code.length); + if (ecma > 5) assert.ok(code.length > result.code.length); assert.strictEqual(eval(code), eval(result.code)); }); });