Skip to content
Snippets Groups Projects
Commit 5ddb903e authored by Rick Waldron's avatar Rick Waldron
Browse files

Merge pull request #393 from anba/non-browser

Improve compatibility for engines without support for Annex B and non-standard features
parents 4cb2d260 ffec41b7
No related branches found
No related tags found
No related merge requests found
Showing
with 102 additions and 2 deletions
......@@ -4,6 +4,7 @@
/*---
info: "CharacterEscape :: c ControlLetter"
es5id: 15.10.2.10_A2.1_T3
es6id: B.1.4
description: "ControlLetter :: RUSSIAN ALPHABET is incorrect"
---*/
......
......@@ -7,6 +7,7 @@ info: >
evaluates by evaluating ClassRanges to obtain a CharSet and returning
that CharSet and the boolean false
es5id: 15.10.2.13_A1_T16
es6id: B.1.4
description: >
Execute /[\d][\12-\14]{1,}[^\d]/.exec("line1\n\n\n\n\nline2") and
check results
......
......@@ -7,6 +7,7 @@ info: >
matches the result of the nth set of capturing parentheses (see
15.10.2.11)
es5id: 15.10.2.9_A1_T4
es6id: B.1.4
description: >
Execute /\b(\w+) \2\b/.test("do you listen the the band") and
check results
......
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: >
RegularExpressionFirstChar :: BackslashSequence :: \NonTerminator,
RegularExpressionChars :: [empty], RegularExpressionFlags :: [empty]
es5id: 7.8.5_A1.4_T2
es6id: 11.8.5
description: Complex test with eval, using syntax pattern
---*/
for (var cu = 0; cu <= 0xffff; ++cu) {
var Elimination =
((cu === 0x002A) || (cu === 0x002F) || (cu === 0x005C) || (cu === 0x002B) ||
(cu === 0x003F) || (cu === 0x0028) || (cu === 0x0029) ||
(cu === 0x005B) || (cu === 0x005D) || (cu === 0x007B) || (cu === 0x007D));
/*
* \u002A / \u002F \ \u005C + \u002B
? \u003F ( \u0028 ) \u0029
[ \u005B ] \u005D { \u007B } \u007D
*/
var LineTerminator = ((cu === 0x000A) || (cu === 0x000D) || (cu === 0x2028) || (cu === 0x2029));
if ((Elimination || LineTerminator ) === false) {
var xx = "\\" + String.fromCharCode(cu);
var pattern = eval("/" + xx + "/");
assert.sameValue(pattern.source, xx, "Code unit: " + cu.toString(16));
}
}
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: >
RegularExpressionFirstChar :: BackslashSequence :: \NonTerminator,
RegularExpressionChars :: [empty], RegularExpressionFlags :: [empty]
es5id: 7.8.5_A1.4_T1
es6id: 11.8.5
description: Check similar to (/\1/.source === "\\1")
---*/
assert.sameValue(/\1/.source, "\\1");
assert.sameValue(/\a/.source, "\\a");
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: >
RegularExpressionChar :: BackslashSequence :: \NonTerminator,
RegularExpressionFlags :: [empty]
es5id: 7.8.5_A2.4_T2
es6id: 11.8.5
description: Complex test with eval, using syntax pattern
---*/
for (var cu = 0; cu <= 0xffff; ++cu) {
var Elimination =
((cu === 0x002A) || (cu === 0x002F) || (cu === 0x005C) || (cu === 0x002B) ||
(cu === 0x003F) || (cu === 0x0028) || (cu === 0x0029) ||
(cu === 0x005B) || (cu === 0x005D) || (cu === 0x007B) || (cu === 0x007D));
/*
* \u002A / \u002F \ \u005C + \u002B
? \u003F ( \u0028 ) \u0029
[ \u005B ] \u005D { \u007B } \u007D
*/
var LineTerminator = ((cu === 0x000A) || (cu === 0x000D) || (cu === 0x2028) || (cu === 0x2029));
if ((Elimination || LineTerminator ) === false) {
var xx = "a\\" + String.fromCharCode(cu);
var pattern = eval("/" + xx + "/");
assert.sameValue(pattern.source, xx, "Code unit: " + cu.toString(16));
}
}
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: >
RegularExpressionChar :: BackslashSequence :: \NonTerminator,
RegularExpressionFlags :: [empty]
es5id: 7.8.5_A2.4_T1
es6id: 11.8.5
description: Check similar to (/a\1/.source === "a\\1")
---*/
assert.sameValue(/a\1/.source, "a\\1");
assert.sameValue(/a\a/.source, "a\\a");
......@@ -3,10 +3,10 @@
/*---
es5id: 12.14-2
es6id: B.3.5
description: >
catch doesn't change declaration scope - var initializer in catch
with same name as catch parameter changes parameter
features: [AnnexB]
---*/
function capturedFoo() {return foo};
......
......@@ -3,10 +3,10 @@
/*---
es5id: 12.14-1
es6id: B.3.5
description: >
catch doesn't change declaration scope - var initializer in catch
with same name as catch parameter changes parameter
features: [AnnexB]
---*/
foo = "prior to throw";
......
......@@ -7,6 +7,7 @@ description: >
Strict mode - checking access to non-strict function caller from
non-strict function (eval includes strict directive prologue)
flags: [noStrict]
features: [caller]
---*/
eval("\"use strict\";\ngNonStrict();");
......
......@@ -8,6 +8,7 @@ description: >
non-strict function (indirect eval includes strict directive
prologue)
flags: [noStrict]
features: [caller]
---*/
var my_eval = eval;
......
......@@ -8,6 +8,7 @@ description: >
non-strict function (non-strict function declaration called by
strict function declaration)
flags: [noStrict]
features: [caller]
---*/
function f() { return gNonStrict();};
......
......@@ -8,6 +8,7 @@ description: >
non-strict function (non-strict function declaration called by
strict eval)
flags: [noStrict]
features: [caller]
---*/
function f() { return gNonStrict();};
......
......@@ -8,6 +8,7 @@ description: >
non-strict function (non-strict function declaration called by
strict Function constructor)
flags: [noStrict]
features: [caller]
---*/
function f() {return gNonStrict();};
......
......@@ -8,6 +8,7 @@ description: >
non-strict function (non-strict function declaration called by
strict new'ed Function constructor)
flags: [noStrict]
features: [caller]
---*/
function f() { return gNonStrict();};
......
......@@ -8,6 +8,7 @@ description: >
non-strict function (non-strict function declaration called by
strict Function.prototype.apply())
flags: [noStrict]
features: [caller]
---*/
function f() { return gNonStrict();};
......
......@@ -8,6 +8,7 @@ description: >
non-strict function (non-strict function declaration called by
strict Function.prototype.apply(null))
flags: [noStrict]
features: [caller]
---*/
function f() { return gNonStrict();};
......
......@@ -8,6 +8,7 @@ description: >
non-strict function (non-strict function declaration called by
strict Function.prototype.apply(undefined))
flags: [noStrict]
features: [caller]
---*/
function f() { return gNonStrict();};
......
......@@ -8,6 +8,7 @@ description: >
non-strict function (non-strict function declaration called by
strict Function.prototype.apply(someObject))
flags: [noStrict]
features: [caller]
---*/
function f() { return gNonStrict();};
......
......@@ -8,6 +8,7 @@ description: >
non-strict function (non-strict function declaration called by
strict Function.prototype.apply(globalObject))
flags: [noStrict]
features: [caller]
includes: [fnGlobalObject.js]
---*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment