diff --git a/test/built-ins/RegExp/S15.10.2.10_A2.1_T3.js b/test/annexB/RegExp-control-escape-russian-letter.js similarity index 98% rename from test/built-ins/RegExp/S15.10.2.10_A2.1_T3.js rename to test/annexB/RegExp-control-escape-russian-letter.js index 6602fc354f03db0d0892f1880dbda4f0614a7ac9..33dd5fb05e37ec2e9cd3d44773b5ad7ca6e9b19f 100644 --- a/test/built-ins/RegExp/S15.10.2.10_A2.1_T3.js +++ b/test/annexB/RegExp-control-escape-russian-letter.js @@ -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" ---*/ diff --git a/test/built-ins/RegExp/S15.10.2.13_A1_T16.js b/test/annexB/RegExp-decimal-escape-class-range.js similarity index 99% rename from test/built-ins/RegExp/S15.10.2.13_A1_T16.js rename to test/annexB/RegExp-decimal-escape-class-range.js index 814023d3650581168d11c33533d9d9395d569fdb..a6646230f3f40882e1a81a1c78719665ac656c74 100644 --- a/test/built-ins/RegExp/S15.10.2.13_A1_T16.js +++ b/test/annexB/RegExp-decimal-escape-class-range.js @@ -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 diff --git a/test/built-ins/RegExp/S15.10.2.9_A1_T4.js b/test/annexB/RegExp-decimal-escape-not-capturing.js similarity index 97% rename from test/built-ins/RegExp/S15.10.2.9_A1_T4.js rename to test/annexB/RegExp-decimal-escape-not-capturing.js index fe7edd337bf91950e54c7c2b87160955b2bd7168..219cf0b77d71700cfe5f5fc8611ba606d3d45b4e 100644 --- a/test/built-ins/RegExp/S15.10.2.9_A1_T4.js +++ b/test/annexB/RegExp-decimal-escape-not-capturing.js @@ -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 diff --git a/test/annexB/RegExp-leading-escape-BMP.js b/test/annexB/RegExp-leading-escape-BMP.js new file mode 100644 index 0000000000000000000000000000000000000000..76dc3e507b07308556e80cf5e5032d79951471dd --- /dev/null +++ b/test/annexB/RegExp-leading-escape-BMP.js @@ -0,0 +1,29 @@ +// 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)); + } +} diff --git a/test/annexB/RegExp-leading-escape.js b/test/annexB/RegExp-leading-escape.js new file mode 100644 index 0000000000000000000000000000000000000000..07b98c6a65bee3e158b5835c9cd7c19eef345ccd --- /dev/null +++ b/test/annexB/RegExp-leading-escape.js @@ -0,0 +1,14 @@ +// 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"); diff --git a/test/annexB/RegExp-trailing-escape-BMP.js b/test/annexB/RegExp-trailing-escape-BMP.js new file mode 100644 index 0000000000000000000000000000000000000000..4adebb8e094c9d2b9237bbc198c203f94e101ba1 --- /dev/null +++ b/test/annexB/RegExp-trailing-escape-BMP.js @@ -0,0 +1,29 @@ +// 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)); + } +} diff --git a/test/annexB/RegExp-trailing-escape.js b/test/annexB/RegExp-trailing-escape.js new file mode 100644 index 0000000000000000000000000000000000000000..c7f2f1402d4759868c14728f200d2348ac89d166 --- /dev/null +++ b/test/annexB/RegExp-trailing-escape.js @@ -0,0 +1,14 @@ +// 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"); diff --git a/test/language/statements/try/12.14-2.js b/test/annexB/catch-redeclared-var-statement-captured.js similarity index 96% rename from test/language/statements/try/12.14-2.js rename to test/annexB/catch-redeclared-var-statement-captured.js index 7ddd343aa051bd9f9152f3f15b8cd2c175045d6a..3c14ebef3b6fbf240fc1877cb078c0007606d600 100644 --- a/test/language/statements/try/12.14-2.js +++ b/test/annexB/catch-redeclared-var-statement-captured.js @@ -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}; diff --git a/test/language/statements/try/12.14-1.js b/test/annexB/catch-redeclared-var-statement.js similarity index 96% rename from test/language/statements/try/12.14-1.js rename to test/annexB/catch-redeclared-var-statement.js index c7c8bf2f8c3004d8e162017630a88bb4749b0f1c..d3a9f69af51f519087c509f46c8b51d921dd6f06 100644 --- a/test/language/statements/try/12.14-1.js +++ b/test/annexB/catch-redeclared-var-statement.js @@ -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"; diff --git a/test/built-ins/Function/15.3.5.4_2-12gs.js b/test/built-ins/Function/15.3.5.4_2-12gs.js index baa5ca6d2a85d0182515fc21681e99111d08a21f..4b1fc536381245155c435d39d55fb56a4dacb727 100644 --- a/test/built-ins/Function/15.3.5.4_2-12gs.js +++ b/test/built-ins/Function/15.3.5.4_2-12gs.js @@ -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();"); diff --git a/test/built-ins/Function/15.3.5.4_2-14gs.js b/test/built-ins/Function/15.3.5.4_2-14gs.js index 6027e1f3409475ffabce69cfed1c6e592b82094a..0df946d586724b2c9a084d2b2311fb236a8fd5b6 100644 --- a/test/built-ins/Function/15.3.5.4_2-14gs.js +++ b/test/built-ins/Function/15.3.5.4_2-14gs.js @@ -8,6 +8,7 @@ description: > non-strict function (indirect eval includes strict directive prologue) flags: [noStrict] +features: [caller] ---*/ var my_eval = eval; diff --git a/test/built-ins/Function/15.3.5.4_2-75gs.js b/test/built-ins/Function/15.3.5.4_2-75gs.js index 0de454da882301e8050471d61e8af9842ddd2aee..b39e30f70e6aac4248541268b2741cabc8ff0bd0 100644 --- a/test/built-ins/Function/15.3.5.4_2-75gs.js +++ b/test/built-ins/Function/15.3.5.4_2-75gs.js @@ -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();}; diff --git a/test/built-ins/Function/15.3.5.4_2-76gs.js b/test/built-ins/Function/15.3.5.4_2-76gs.js index 618b8e2d28f1b536fb50e46a74b9a82a0570dcc2..9da118714e8fb5c875392d7a7cd22418d2f4762b 100644 --- a/test/built-ins/Function/15.3.5.4_2-76gs.js +++ b/test/built-ins/Function/15.3.5.4_2-76gs.js @@ -8,6 +8,7 @@ description: > non-strict function (non-strict function declaration called by strict eval) flags: [noStrict] +features: [caller] ---*/ function f() { return gNonStrict();}; diff --git a/test/built-ins/Function/15.3.5.4_2-77gs.js b/test/built-ins/Function/15.3.5.4_2-77gs.js index f41674dace2000a81d12b19c3406694ed51bae79..572e3820537101dbf760e89dd4ba6177506477a7 100644 --- a/test/built-ins/Function/15.3.5.4_2-77gs.js +++ b/test/built-ins/Function/15.3.5.4_2-77gs.js @@ -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();}; diff --git a/test/built-ins/Function/15.3.5.4_2-78gs.js b/test/built-ins/Function/15.3.5.4_2-78gs.js index bea139fc48551cfeff8bb8f095efc477632d498e..80aa51604e74f8190639d8ef7a10fc2c8002927a 100644 --- a/test/built-ins/Function/15.3.5.4_2-78gs.js +++ b/test/built-ins/Function/15.3.5.4_2-78gs.js @@ -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();}; diff --git a/test/built-ins/Function/15.3.5.4_2-79gs.js b/test/built-ins/Function/15.3.5.4_2-79gs.js index bd64d799cdb547aed464ae9b5de2a2ab31dc5483..e0814d0d231dbe5df0dae31b38211194a3b6935c 100644 --- a/test/built-ins/Function/15.3.5.4_2-79gs.js +++ b/test/built-ins/Function/15.3.5.4_2-79gs.js @@ -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();}; diff --git a/test/built-ins/Function/15.3.5.4_2-80gs.js b/test/built-ins/Function/15.3.5.4_2-80gs.js index 9e6482fbfc0ae61a9c1706e37cae00529f62ac82..aa03f3ec213b95e7d831c6ee0fb16834832c298d 100644 --- a/test/built-ins/Function/15.3.5.4_2-80gs.js +++ b/test/built-ins/Function/15.3.5.4_2-80gs.js @@ -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();}; diff --git a/test/built-ins/Function/15.3.5.4_2-81gs.js b/test/built-ins/Function/15.3.5.4_2-81gs.js index ecc3234b0e647ebb75132b4abed55d2300037ede..e3f028da4c3bcaaedfcee93a13ffe840afa71048 100644 --- a/test/built-ins/Function/15.3.5.4_2-81gs.js +++ b/test/built-ins/Function/15.3.5.4_2-81gs.js @@ -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();}; diff --git a/test/built-ins/Function/15.3.5.4_2-82gs.js b/test/built-ins/Function/15.3.5.4_2-82gs.js index 55a7da5a09b30b0f422d9845a86735476d91537e..7a78c1726c49ee4eed454d6f3b965f9c1fcd8274 100644 --- a/test/built-ins/Function/15.3.5.4_2-82gs.js +++ b/test/built-ins/Function/15.3.5.4_2-82gs.js @@ -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();}; diff --git a/test/built-ins/Function/15.3.5.4_2-83gs.js b/test/built-ins/Function/15.3.5.4_2-83gs.js index 70a8b6ff80742241616f42ae91fb78134575574e..99d68c861acb7a7a7ecbf0e8a3f63f0ca71c37fb 100644 --- a/test/built-ins/Function/15.3.5.4_2-83gs.js +++ b/test/built-ins/Function/15.3.5.4_2-83gs.js @@ -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] ---*/ diff --git a/test/built-ins/Function/15.3.5.4_2-84gs.js b/test/built-ins/Function/15.3.5.4_2-84gs.js index b91a85b2440cd71795684dd900d5f042bbc59c0c..ecc1e152dc519706ad9ac75e04df21aafc438646 100644 --- a/test/built-ins/Function/15.3.5.4_2-84gs.js +++ b/test/built-ins/Function/15.3.5.4_2-84gs.js @@ -8,6 +8,7 @@ description: > non-strict function (non-strict function declaration called by strict Function.prototype.call()) flags: [noStrict] +features: [caller] ---*/ function f() { return gNonStrict();}; diff --git a/test/built-ins/Function/15.3.5.4_2-85gs.js b/test/built-ins/Function/15.3.5.4_2-85gs.js index 65888cd8b1229c2a3ee01c70aae571c5cb42152e..ff899ce7c74a0fc99aae134f733670a7d719eb8a 100644 --- a/test/built-ins/Function/15.3.5.4_2-85gs.js +++ b/test/built-ins/Function/15.3.5.4_2-85gs.js @@ -8,6 +8,7 @@ description: > non-strict function (non-strict function declaration called by strict Function.prototype.call(null)) flags: [noStrict] +features: [caller] ---*/ function f() { return gNonStrict();}; diff --git a/test/built-ins/Function/15.3.5.4_2-86gs.js b/test/built-ins/Function/15.3.5.4_2-86gs.js index a0a8f9d464d29f322485fcb3e3ddadad5b0a133d..c617f4eb7381dbd85669c07ba30e94cf2e14f61e 100644 --- a/test/built-ins/Function/15.3.5.4_2-86gs.js +++ b/test/built-ins/Function/15.3.5.4_2-86gs.js @@ -8,6 +8,7 @@ description: > non-strict function (non-strict function declaration called by strict Function.prototype.call(undefined)) flags: [noStrict] +features: [caller] ---*/ function f() { return gNonStrict();}; diff --git a/test/built-ins/Function/15.3.5.4_2-87gs.js b/test/built-ins/Function/15.3.5.4_2-87gs.js index ff206e3d1f832003dfaaa036da4f7f2c84256f03..c2ba6514203dd7b2b33d50f7d29ab252d81e4d7d 100644 --- a/test/built-ins/Function/15.3.5.4_2-87gs.js +++ b/test/built-ins/Function/15.3.5.4_2-87gs.js @@ -8,6 +8,7 @@ description: > non-strict function (non-strict function declaration called by strict Function.prototype.call(someObject)) flags: [noStrict] +features: [caller] ---*/ function f() { return gNonStrict();}; diff --git a/test/built-ins/Function/15.3.5.4_2-88gs.js b/test/built-ins/Function/15.3.5.4_2-88gs.js index caf238e2281df14e0cb7049d30112f7979053a99..f2506fd4f52efc917861b48f9a8480253d70ed50 100644 --- a/test/built-ins/Function/15.3.5.4_2-88gs.js +++ b/test/built-ins/Function/15.3.5.4_2-88gs.js @@ -8,6 +8,7 @@ description: > non-strict function (non-strict function declaration called by strict Function.prototype.call(globalObject)) flags: [noStrict] +features: [caller] includes: [fnGlobalObject.js] ---*/ diff --git a/test/built-ins/Function/15.3.5.4_2-89gs.js b/test/built-ins/Function/15.3.5.4_2-89gs.js index ed36985817ecb558008b92b92612483b925751e9..ec574b3a7df626ffa874b93a3618eb2e56b5cc90 100644 --- a/test/built-ins/Function/15.3.5.4_2-89gs.js +++ b/test/built-ins/Function/15.3.5.4_2-89gs.js @@ -8,6 +8,7 @@ description: > non-strict function (non-strict function declaration called by strict Function.prototype.bind()()) flags: [noStrict] +features: [caller] ---*/ function f() { return gNonStrict();}; diff --git a/test/built-ins/Function/15.3.5.4_2-90gs.js b/test/built-ins/Function/15.3.5.4_2-90gs.js index f90d05026bc819109ab3bd1af7ad1fcc988185ce..bbab075d19a1c5112b9fd4400925058866c67db2 100644 --- a/test/built-ins/Function/15.3.5.4_2-90gs.js +++ b/test/built-ins/Function/15.3.5.4_2-90gs.js @@ -8,6 +8,7 @@ description: > non-strict function (non-strict function declaration called by strict Function.prototype.bind(null)()) flags: [noStrict] +features: [caller] ---*/ function f() { return gNonStrict();}; diff --git a/test/built-ins/Function/15.3.5.4_2-91gs.js b/test/built-ins/Function/15.3.5.4_2-91gs.js index e35b5d4b6b37da111829a54f3ab56fa5fda6141a..1049047f04d772d22402c505a66969923245cf7c 100644 --- a/test/built-ins/Function/15.3.5.4_2-91gs.js +++ b/test/built-ins/Function/15.3.5.4_2-91gs.js @@ -8,6 +8,7 @@ description: > non-strict function (non-strict function declaration called by strict Function.prototype.bind(undefined)()) flags: [noStrict] +features: [caller] ---*/ function f() { return gNonStrict();}; diff --git a/test/built-ins/Function/15.3.5.4_2-92gs.js b/test/built-ins/Function/15.3.5.4_2-92gs.js index 9cdad5bdd77b8e64173d98259556cc3531d19056..8ff2abc398572ab2a5962157ef308ce5cda8f71c 100644 --- a/test/built-ins/Function/15.3.5.4_2-92gs.js +++ b/test/built-ins/Function/15.3.5.4_2-92gs.js @@ -8,6 +8,7 @@ description: > non-strict function (non-strict function declaration called by strict Function.prototype.bind(someObject)()) flags: [noStrict] +features: [caller] ---*/ function f() { return gNonStrict();}; diff --git a/test/built-ins/Function/15.3.5.4_2-93gs.js b/test/built-ins/Function/15.3.5.4_2-93gs.js index 7a1da90b556a16eaccd8d9d24dbc79712cdda7bd..78d9e70393914176310b0fcfc448f767dded0b67 100644 --- a/test/built-ins/Function/15.3.5.4_2-93gs.js +++ b/test/built-ins/Function/15.3.5.4_2-93gs.js @@ -8,6 +8,7 @@ description: > non-strict function (non-strict function declaration called by strict Function.prototype.bind(globalObject)()) flags: [noStrict] +features: [caller] includes: [fnGlobalObject.js] ---*/ diff --git a/test/built-ins/RegExp/S15.10.2.10_A5.1_T1.js b/test/built-ins/RegExp/S15.10.2.10_A5.1_T1.js index 2d85e1670d94a7f7b43e67bf339253e819791cf5..8805e44e56968650c53b6d86f9cfacd3afb7c544 100644 --- a/test/built-ins/RegExp/S15.10.2.10_A5.1_T1.js +++ b/test/built-ins/RegExp/S15.10.2.10_A5.1_T1.js @@ -11,12 +11,8 @@ description: "Tested string is \"~`!@#$%^&*()-+={[}]|\\\\:;'<,>./?\" + '\"'" //CHECK#1 var non_ident = "~`!@#$%^&*()-+={[}]|\\:;'<,>./?" + '"'; -var k = -1; -do { - k++; - var arr = new RegExp("\\" + non_ident[k], "g").exec(non_ident); -} while ((arr !== null) && (arr[0] === non_ident[k])) - -if (non_ident.length !== k) { - $ERROR('#1: IdentityEscapeSequence :: SourceCharacter but not IdentifierPart'); +for (var k = 0; k < non_ident.length; ++k) { + var arr = new RegExp("\\" + non_ident[k], "g").exec(non_ident); + assert.notSameValue(null, "No match for character: " + non_ident[k]); + assert.sameValue(arr[0], non_ident[k]); } diff --git a/test/built-ins/RegExp/S15.10.2.6_A4_T7.js b/test/built-ins/RegExp/S15.10.2.6_A4_T7.js index 85170504806fe6df29cdfba27b2bbe32260eee99..26410af86a6b8c3312c308ab193bfb09f3cb2368 100644 --- a/test/built-ins/RegExp/S15.10.2.6_A4_T7.js +++ b/test/built-ins/RegExp/S15.10.2.6_A4_T7.js @@ -7,13 +7,34 @@ info: > AssertionTester closure that takes a State argument x and performs the ... es5id: 15.10.2.6_A4_T7 description: > - Execute /\B\[^z]{4}\B/.test("devil arise\tforzzx\nevils") and + Execute /\B[^z]{4}\B/.exec("devil arise\tforzzx\nevils") and check results ---*/ -var __executed = /\B\[^z]{4}\B/.test("devil arise\tforzzx\nevils"); +var __executed = /\B[^z]{4}\B/.exec("devil arise\tforzzx\nevils"); + +var __expected = ["il a"]; +__expected.index = 3; +__expected.input = "devil arise\tforzzx\nevils"; //CHECK#1 -if (__executed) { - $ERROR('#1: /\\B\\[^z]{4}\\B/.test("devil arise\\tforzzx\\nevils") === false'); +if (__executed.length !== __expected.length) { + $ERROR('#1: __executed = /\B[^z]{4}\B/.exec("devil arise\\tforzzx\\nevils"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length); +} + +//CHECK#2 +if (__executed.index !== __expected.index) { + $ERROR('#2: __executed = /\B[^z]{4}\B/.exec("devil arise\\tforzzx\\nevils"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index); +} + +//CHECK#3 +if (__executed.input !== __expected.input) { + $ERROR('#3: __executed = /\B[^z]{4}\B/.exec("devil arise\\tforzzx\\nevils"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input); +} + +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__executed[index] !== __expected[index]) { + $ERROR('#4: __executed = /\B[^z]{4}\B/.exec("devil arise\\tforzzx\\nevils"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]); + } } diff --git a/test/built-ins/RegExp/S15.10.2_A1_T1.js b/test/built-ins/RegExp/S15.10.2_A1_T1.js index b2a8708926d4a15d4612db24e3c031911d2216cf..9ebce76ca21e9631fed214a60eec711d72eace64 100644 --- a/test/built-ins/RegExp/S15.10.2_A1_T1.js +++ b/test/built-ins/RegExp/S15.10.2_A1_T1.js @@ -20,20 +20,20 @@ var TextSE = "[^<]+"; var UntilHyphen = "[^-]*-"; var Until2Hyphens = UntilHyphen + "([^-]" + UntilHyphen + ")*-"; var CommentCE = Until2Hyphens + ">?"; -var UntilRSBs = "[^]]*]([^]]+])*]+"; -var CDATA_CE = UntilRSBs + "([^]>]" + UntilRSBs + ")*>"; +var UntilRSBs = "[^\\]]*\\]([^\\]]+\\])*\\]+"; +var CDATA_CE = UntilRSBs + "([^\\]>]" + UntilRSBs + ")*>"; var S = "[ \\n\\t\\r]+"; var NameStrt = "[A-Za-z_:]|[^\\x00-\\x7F]"; var NameChar = "[A-Za-z0-9_:.-]|[^\\x00-\\x7F]"; var Name = "(" + NameStrt + ")(" + NameChar + ")*"; var QuoteSE = '"[^"]' + "*" + '"' + "|'[^']*'"; var DT_IdentSE = S + Name + "(" + S + "(" + Name + "|" + QuoteSE + "))*"; -var MarkupDeclCE = "([^]\"'><]+|" + QuoteSE + ")*>"; +var MarkupDeclCE = "([^\\]\"'><]+|" + QuoteSE + ")*>"; var S1 = "[\\n\\r\\t ]"; var UntilQMs = "[^?]*\\?+"; var PI_Tail = "\\?>|" + S1 + UntilQMs + "([^>?]" + UntilQMs + ")*>"; var DT_ItemSE = "<(!(--" + Until2Hyphens + ">|[^-]" + MarkupDeclCE + ")|\\?" + Name + "(" + PI_Tail + "))|%" + Name + ";|" + S; -var DocTypeCE = DT_IdentSE + "(" + S + ")?(\\[(" + DT_ItemSE + ")*](" + S + ")?)?>?"; +var DocTypeCE = DT_IdentSE + "(" + S + ")?(\\[(" + DT_ItemSE + ")*\\](" + S + ")?)?>?"; var DeclCE = "--(" + CommentCE + ")?|\\[CDATA\\[(" + CDATA_CE + ")?|DOCTYPE(" + DocTypeCE + ")?"; var PI_CE = Name + "(" + PI_Tail + ")?"; var EndTagCE = Name + "(" + S + ")?>?"; diff --git a/test/language/arguments-object/10.6-13-a-2.js b/test/language/arguments-object/10.6-13-a-2.js index da803ecffba28e4a3d973f2e99ecd8b589502441..c80a20d8bdef9e5e35ce87a260e84e67c1d52313 100644 --- a/test/language/arguments-object/10.6-13-a-2.js +++ b/test/language/arguments-object/10.6-13-a-2.js @@ -5,6 +5,7 @@ es5id: 10.6-13-a-2 description: A direct call to arguments.callee.caller should work flags: [noStrict] +features: [caller] ---*/ var called = false; diff --git a/test/language/arguments-object/10.6-13-a-3.js b/test/language/arguments-object/10.6-13-a-3.js index 4ed593ea67e44eb287d2e656896391a6afb2aeda..af87495b5dce684b530059ec8504e7311c00e2ab 100644 --- a/test/language/arguments-object/10.6-13-a-3.js +++ b/test/language/arguments-object/10.6-13-a-3.js @@ -5,6 +5,7 @@ es5id: 10.6-13-a-3 description: An indirect call to arguments.callee.caller should work flags: [noStrict] +features: [caller] ---*/ var called = false; diff --git a/test/language/literals/regexp/S7.8.5_A1.1_T2.js b/test/language/literals/regexp/S7.8.5_A1.1_T2.js index c4b9db604baacfb88217ed323797042b49dad592..0fce03b9867626ce83f082ece28979d99ec16975 100644 --- a/test/language/literals/regexp/S7.8.5_A1.1_T2.js +++ b/test/language/literals/regexp/S7.8.5_A1.1_T2.js @@ -9,46 +9,20 @@ es5id: 7.8.5_A1.1_T2 description: Complex test with eval, using syntax pattern ---*/ -//CHECK -var errorCount = 0; -var count = 0; -var hex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]; -for (var i1 = 0; i1 < 16; i1++) { - for (var i2 = 0; i2 < 16; i2++) { - for (var i3 = 0; i3 < 16; i3++) { - for (var i4 = 0; i4 < 16; i4++) { - try { - var uu = hex[i1] + hex[i2] + hex[i3] + hex[i4]; - var Elimination = - ((uu === "002A") || (uu === "002F") || (uu === "005C") || (uu === "002B") || - (uu === "003F") || (uu === "0028") || (uu === "0029") || - (uu === "005B") || (uu === "005D") || (uu === "007B") || (uu === "007D")); - /* - * \u002A / \u002F \ \u005C + \u002B - ? \u003F ( \u0028 ) \u0029 - [ \u005B ] \u005D { \u007B } \u007D - */ - var LineTerminator = ((uu === "000A") || (uu === "000D") || (uu === "2028") || (uu === "2029")); - if ((Elimination || LineTerminator ) === false) { - var xx = String.fromCharCode("0x" + uu); - var pattern = eval("/" + xx + "/"); - if (pattern.source !== xx) { - $ERROR('#' + uu + ' '); - errorCount++; - } - } else { - count--; - } - } catch (e) { - $ERROR('#' + uu + ' '); - errorCount++; - } - count++; - } - } +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)); } } - -if (errorCount > 0) { - $ERROR('Total error: ' + errorCount + ' bad Regular Expression First Char in ' + count); -} diff --git a/test/language/literals/regexp/S7.8.5_A1.4_T1.js b/test/language/literals/regexp/S7.8.5_A1.4_T1.js index ae824ab0271e2532a31b5bfa8d9ebd0395b72b5e..c4df94cd3698dee0c8faf1f358ec7cbc1cc0caa1 100644 --- a/test/language/literals/regexp/S7.8.5_A1.4_T1.js +++ b/test/language/literals/regexp/S7.8.5_A1.4_T1.js @@ -6,25 +6,15 @@ info: > RegularExpressionFirstChar :: BackslashSequence :: \NonTerminator, RegularExpressionChars :: [empty], RegularExpressionFlags :: [empty] es5id: 7.8.5_A1.4_T1 -description: Check similar to (/\1/.source === "\\1") +description: Check similar to (/\;/.source === "\\;") ---*/ //CHECK#1 -if (/\1/.source !== "\\1") { - $ERROR('#1: /\\1/'); -} - -//CHECK#2 -if (/\a/.source !== "\\a") { - $ERROR('#2: /\\a/'); -} - -//CHECK#3 if (/\;/.source !== "\\;") { - $ERROR('#3: /\\;/'); + $ERROR('#1: /\\;/'); } -//CHECK#4 +//CHECK#2 if (/\ /.source !== "\\ ") { - $ERROR('#4: /\\ /'); + $ERROR('#2: /\\ /'); } diff --git a/test/language/literals/regexp/S7.8.5_A1.4_T2.js b/test/language/literals/regexp/S7.8.5_A1.4_T2.js index 1b4ceda6211301731377bdb7c1f0790e7db0c7c2..7fbab7bc2ad1ea79a43cde5518f3d7de2068bcde 100644 --- a/test/language/literals/regexp/S7.8.5_A1.4_T2.js +++ b/test/language/literals/regexp/S7.8.5_A1.4_T2.js @@ -9,46 +9,32 @@ es5id: 7.8.5_A1.4_T2 description: Complex test with eval, using syntax pattern ---*/ -//CHECK -var errorCount = 0; -var count = 0; -var hex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]; -for (var i1 = 0; i1 < 16; i1++) { - for (var i2 = 0; i2 < 16; i2++) { - for (var i3 = 0; i3 < 16; i3++) { - for (var i4 = 0; i4 < 16; i4++) { +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); + try { + var pattern = eval("/" + xx + "/"); + } catch (e) { + var identifierPartNotUnicodeIDContinue = ((cu === 0x0024) || (cu === 0x200C) || (cu === 0x200D)); + if (e instanceof SyntaxError && !identifierPartNotUnicodeIDContinue) { + // Use eval with var-declaration to check if `cu` is in UnicodeIDContinue. try { - var uu = hex[i1] + hex[i2] + hex[i3] + hex[i4]; - var Elimination = - ((uu === "002A") || (uu === "002F") || (uu === "005C") || (uu === "002B") || - (uu === "003F") || (uu === "0028") || (uu === "0029") || - (uu === "005B") || (uu === "005D") || (uu === "007B") || (uu === "007D")); - /* - * \u002A / \u002F \ \u005C + \u002B - ? \u003F ( \u0028 ) \u0029 - [ \u005B ] \u005D { \u007B } \u007D - */ - var LineTerminator = ((uu === "000A") || (uu === "000D") || (uu === "2028") || (uu === "2029")); - if ((Elimination || LineTerminator ) === false) { - var xx = "\\" + String.fromCharCode("0x" + uu); - var pattern = eval("/" + xx + "/"); - if (pattern.source !== xx) { - $ERROR('#' + uu + ' '); - errorCount++; - } - } else { - count--; - } - } catch (e) { - $ERROR('#' + uu + ' '); - errorCount++; - } - count++; + eval("var _" + String.fromCharCode(cu)); + continue; + } catch (ignore) { } } + throw e; } + assert.sameValue(pattern.source, xx, "Code unit: " + cu.toString(16)); } } - -if (errorCount > 0) { - $ERROR('Total error: ' + errorCount + ' bad Regular Expression First Char in ' + count); -} diff --git a/test/language/literals/regexp/S7.8.5_A2.1_T2.js b/test/language/literals/regexp/S7.8.5_A2.1_T2.js index 216918c58d8b64a1d47c56e884dd143f9bfed2a3..badc5a0b7d1854421f7ec837d850e90ac4a8b2d0 100644 --- a/test/language/literals/regexp/S7.8.5_A2.1_T2.js +++ b/test/language/literals/regexp/S7.8.5_A2.1_T2.js @@ -9,47 +9,20 @@ es5id: 7.8.5_A2.1_T2 description: Complex test with eval, using syntax pattern ---*/ -//CHECK -var errorCount = 0; -var count = 0; -var hex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]; -for (var i1 = 0; i1 < 16; i1++) { - for (var i2 = 0; i2 < 16; i2++) { - for (var i3 = 0; i3 < 16; i3++) { - for (var i4 = 0; i4 < 16; i4++) { - try { - var uu = hex[i1] + hex[i2] + hex[i3] + hex[i4]; - var Elimination = - ((uu === "002A") || (uu === "002F") || (uu === "005C") || (uu === "002B") || - (uu === "003F") || (uu === "0028") || (uu === "0029") || - (uu === "005B") || (uu === "005D") || (uu === "007B") || (uu === "007D")); - /* - * \u002A / \u002F \ \u005C + \u002B - ? \u003F ( \u0028 ) \u0029 - [ \u005B ] \u005D { \u007B } \u007D - */ - var LineTerminator = ((uu === "000A") || (uu === "000D") || (uu === "2028") || (uu === "2029")); - if ((Elimination || LineTerminator ) === false) { - var xx = "nnnn" + String.fromCharCode("0x" + uu); - var pattern = eval("/" + xx + "/"); - if (pattern.source !== xx) { - $ERROR('#' + uu + ' '); - errorCount++; - } - - } else { - count--; - } - } catch (e) { - $ERROR('#' + uu + ' '); - errorCount++; - } - count++; - } - } +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 = "nnnn" + String.fromCharCode(cu); + var pattern = eval("/" + xx + "/"); + assert.sameValue(pattern.source, xx, "Code unit: " + cu.toString(16)); } } - -if (errorCount > 0) { - $ERROR('Total error: ' + errorCount + ' bad Regular Expression First Char in ' + count); -} diff --git a/test/language/literals/regexp/S7.8.5_A2.4_T1.js b/test/language/literals/regexp/S7.8.5_A2.4_T1.js index 72f4ea5467d929bcde7e8ca9203a1768869fe153..10665d439b75850609e0b6e65cc1044485326a59 100644 --- a/test/language/literals/regexp/S7.8.5_A2.4_T1.js +++ b/test/language/literals/regexp/S7.8.5_A2.4_T1.js @@ -6,25 +6,15 @@ info: > RegularExpressionChar :: BackslashSequence :: \NonTerminator, RegularExpressionFlags :: [empty] es5id: 7.8.5_A2.4_T1 -description: Check similar to (/a\1/.source === "a\\1") +description: Check similar to (/,\;/.source === ",\\;") ---*/ //CHECK#1 -if (/a\1/.source !== "a\\1") { - $ERROR('#1: /a\\1/'); -} - -//CHECK#2 -if (/a\a/.source !== "a\\a") { - $ERROR('#2: /a\\a/'); -} - -//CHECK#3 if (/,\;/.source !== ",\\;") { - $ERROR('#3: /,\\;/'); + $ERROR('#1: /,\\;/'); } -//CHECK#4 +//CHECK#2 if (/ \ /.source !== " \\ ") { - $ERROR('#4: / \\ /'); + $ERROR('#2: / \\ /'); } diff --git a/test/language/literals/regexp/S7.8.5_A2.4_T2.js b/test/language/literals/regexp/S7.8.5_A2.4_T2.js index b64ded43f00f2319f3805045c5773f4d00dcec01..6f758f767ba226ba7ceb7e0b50192aa5e4667f3e 100644 --- a/test/language/literals/regexp/S7.8.5_A2.4_T2.js +++ b/test/language/literals/regexp/S7.8.5_A2.4_T2.js @@ -9,46 +9,32 @@ es5id: 7.8.5_A2.4_T2 description: Complex test with eval, using syntax pattern ---*/ -//CHECK -var errorCount = 0; -var count = 0; -var hex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]; -for (var i1 = 0; i1 < 16; i1++) { - for (var i2 = 0; i2 < 16; i2++) { - for (var i3 = 0; i3 < 16; i3++) { - for (var i4 = 0; i4 < 16; i4++) { +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); + try { + var pattern = eval("/" + xx + "/"); + } catch (e) { + var identifierPartNotUnicodeIDContinue = ((cu === 0x0024) || (cu === 0x200C) || (cu === 0x200D)); + if (e instanceof SyntaxError && !identifierPartNotUnicodeIDContinue) { + // Use eval with var-declaration to check if `cu` is in UnicodeIDContinue. try { - var uu = hex[i1] + hex[i2] + hex[i3] + hex[i4]; - var Elimination = - ((uu === "002A") || (uu === "002F") || (uu === "005C") || (uu === "002B") || - (uu === "003F") || (uu === "0028") || (uu === "0029") || - (uu === "005B") || (uu === "005D") || (uu === "007B") || (uu === "007D")); - /* - * \u002A / \u002F \ \u005C + \u002B - ? \u003F ( \u0028 ) \u0029 - [ \u005B ] \u005D { \u007B } \u007D - */ - var LineTerminator = ((uu === "000A") || (uu === "000D") || (uu === "2028") || (uu === "2029")); - if ((Elimination || LineTerminator ) === false) { - var xx = "a\\" + String.fromCharCode("0x" + uu); - var pattern = eval("/" + xx + "/"); - if (pattern.source !== xx) { - $ERROR('#' + uu + ' '); - errorCount++; - } - } else { - count--; - } - } catch (e) { - $ERROR('#' + uu + ' '); - errorCount++; - } - count++; + eval("var _" + String.fromCharCode(cu)); + continue; + } catch (ignore) { } } + throw e; } + assert.sameValue(pattern.source, xx, "Code unit: " + cu.toString(16)); } } - -if (errorCount > 0) { - $ERROR('Total error: ' + errorCount + ' bad Regular Expression First Char in ' + count); -}