From ade6d2e384350055e1e23c35cfbf0d4dab03c82e Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Sun, 13 Mar 2016 13:21:02 -0400 Subject: [PATCH] Remove "NotEarlyError" object Because expectations regarding error "phase" are now expressed via test meta-data, the test runner may now enforce this requirement on negative tests. Remove the "NotEarlyError" from the project source. This reduces the amount of domain knowledge required to author tests and lessens the potential for inconsistencies between tests. --- CONTRIBUTING.md | 11 ----------- harness/sta.js | 4 ---- test/language/arguments-object/10.5-1gs.js | 1 - test/language/directive-prologue/10.1.1-8gs.js | 1 - test/language/expressions/delete/11.4.1-5-a-5gs.js | 1 - test/language/expressions/object/11.1.5-1gs.js | 1 - .../expressions/postfix-increment/11.3.1-2-1gs.js | 1 - .../expressions/prefix-decrement/11.4.5-2-2gs.js | 1 - test/language/expressions/this/11.1.1-1gs.js | 5 ++--- test/language/literals/numeric/7.8.3-1gs.js | 1 - test/language/literals/numeric/7.8.3-2gs.js | 1 - test/language/literals/regexp/7.8.5-1gs.js | 1 - test/language/literals/string/7.8.4-1gs.js | 1 - test/language/reserved-words/7.6.1.2-1gs.js | 1 - .../const-declaring-let-split-across-two-lines.js | 1 - test/language/statements/function/13.0_4-5gs.js | 1 - test/language/statements/function/13.1-13gs.js | 1 - test/language/statements/function/13.1-1gs.js | 1 - test/language/statements/function/13.1-4gs.js | 1 - test/language/statements/function/13.1-5gs.js | 1 - test/language/statements/function/13.1-8gs.js | 1 - .../let-let-declaration-split-across-two-lines.js | 1 - ...aration-with-initializer-split-across-two-lines.js | 1 - test/language/statements/try/12.14.1-1gs.js | 1 - test/language/statements/variable/12.2.1-1gs.js | 1 - test/language/statements/variable/12.2.1-4gs.js | 1 - test/language/statements/with/12.10.1-11gs.js | 1 - 27 files changed, 2 insertions(+), 42 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 25d1b05f4c..a3230e9f7d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -157,12 +157,6 @@ assert.sameValue(actual, expected, message) | throw a new Test262Error instance assert.notSameValue(actual, unexpected, message) | throw a new Test262Error instance if the first two arguments are [the same value](http://www.ecma-international.org/ecma-262/6.0/#sec-samevalue); accepts an optional string message for use in creating the error assert.throws(expectedErrorConstructor, fn) | throw a new Test262Error instance if the provided function does not throw an error, or if the constructor of the value thrown does not match the provided constructor -The test harness also defines the following objects: - -Identifier | Purpose ------------|-------- -NotEarlyError | preconstructed error object used for testing syntax and other early errors; see Syntax Error & Early Error, below - ``` /// error class function Test262Error(message) { @@ -178,8 +172,6 @@ function $ERROR(message) { function $DONE(arg) { //[omitted body] } - -var NotEarlyError = new Error(...); ``` ## Handling Errors and Negative Test Cases @@ -193,9 +185,6 @@ negative: type: SyntaxError ---*/ -// This `throw` statement guarantees that no code is executed in order to -// trigger the SyntaxError. -throw NotEarlyError; var var = var; ``` diff --git a/harness/sta.js b/harness/sta.js index 5a95afb184..10a6bb3fab 100644 --- a/harness/sta.js +++ b/harness/sta.js @@ -1,10 +1,6 @@ /// Copyright (c) 2012 Ecma International. All rights reserved. /// This code is governed by the BSD license found in the LICENSE file. -var NotEarlyErrorString = "NotEarlyError"; -var EarlyErrorRePat = "^((?!" + NotEarlyErrorString + ").)*$"; -var NotEarlyError = new Error(NotEarlyErrorString); - function Test262Error(message) { this.message = message || ""; } diff --git a/test/language/arguments-object/10.5-1gs.js b/test/language/arguments-object/10.5-1gs.js index 5896b189f3..0c148e5550 100644 --- a/test/language/arguments-object/10.5-1gs.js +++ b/test/language/arguments-object/10.5-1gs.js @@ -10,7 +10,6 @@ negative: flags: [onlyStrict] ---*/ -throw NotEarlyError; function f_10_5_1_gs(){ arguments = 7; diff --git a/test/language/directive-prologue/10.1.1-8gs.js b/test/language/directive-prologue/10.1.1-8gs.js index c83cd56fa3..9a298adf02 100644 --- a/test/language/directive-prologue/10.1.1-8gs.js +++ b/test/language/directive-prologue/10.1.1-8gs.js @@ -14,5 +14,4 @@ flags: [raw] "use strict"; "use strict"; -throw NotEarlyError; var public = 1; diff --git a/test/language/expressions/delete/11.4.1-5-a-5gs.js b/test/language/expressions/delete/11.4.1-5-a-5gs.js index aeb1deefd5..47c379e480 100644 --- a/test/language/expressions/delete/11.4.1-5-a-5gs.js +++ b/test/language/expressions/delete/11.4.1-5-a-5gs.js @@ -13,5 +13,4 @@ flags: [onlyStrict] ---*/ var _11_4_1_5 = 7; -throw NotEarlyError; delete _11_4_1_5; diff --git a/test/language/expressions/object/11.1.5-1gs.js b/test/language/expressions/object/11.1.5-1gs.js index 2db6251257..3ce097d926 100644 --- a/test/language/expressions/object/11.1.5-1gs.js +++ b/test/language/expressions/object/11.1.5-1gs.js @@ -13,5 +13,4 @@ negative: flags: [onlyStrict] ---*/ -throw NotEarlyError; var obj = { set _11_1_5_1_fun(eval) {}}; diff --git a/test/language/expressions/postfix-increment/11.3.1-2-1gs.js b/test/language/expressions/postfix-increment/11.3.1-2-1gs.js index 35d1ea627d..bbe5b5523b 100644 --- a/test/language/expressions/postfix-increment/11.3.1-2-1gs.js +++ b/test/language/expressions/postfix-increment/11.3.1-2-1gs.js @@ -12,5 +12,4 @@ negative: flags: [onlyStrict] ---*/ -throw NotEarlyError; arguments++; diff --git a/test/language/expressions/prefix-decrement/11.4.5-2-2gs.js b/test/language/expressions/prefix-decrement/11.4.5-2-2gs.js index 6c22e85fc2..a1e105b55c 100644 --- a/test/language/expressions/prefix-decrement/11.4.5-2-2gs.js +++ b/test/language/expressions/prefix-decrement/11.4.5-2-2gs.js @@ -12,5 +12,4 @@ negative: flags: [onlyStrict] ---*/ -throw NotEarlyError; --arguments; diff --git a/test/language/expressions/this/11.1.1-1gs.js b/test/language/expressions/this/11.1.1-1gs.js index 63ad2319ef..569fc6139a 100644 --- a/test/language/expressions/this/11.1.1-1gs.js +++ b/test/language/expressions/this/11.1.1-1gs.js @@ -8,6 +8,5 @@ flags: [onlyStrict] ---*/ "use strict"; -if (this===undefined) { - throw NotEarlyError; -} + +assert.notSameValue(this, undefined); diff --git a/test/language/literals/numeric/7.8.3-1gs.js b/test/language/literals/numeric/7.8.3-1gs.js index 05e7ac6f8a..090189eb6b 100644 --- a/test/language/literals/numeric/7.8.3-1gs.js +++ b/test/language/literals/numeric/7.8.3-1gs.js @@ -10,5 +10,4 @@ negative: flags: [onlyStrict] ---*/ -throw NotEarlyError; var y = 010; diff --git a/test/language/literals/numeric/7.8.3-2gs.js b/test/language/literals/numeric/7.8.3-2gs.js index e2f3ad49e4..f208ba6008 100644 --- a/test/language/literals/numeric/7.8.3-2gs.js +++ b/test/language/literals/numeric/7.8.3-2gs.js @@ -12,7 +12,6 @@ negative: flags: [onlyStrict] ---*/ -throw NotEarlyError; var a; a = 0x1; a = 01; diff --git a/test/language/literals/regexp/7.8.5-1gs.js b/test/language/literals/regexp/7.8.5-1gs.js index cfb8b07960..e057a85561 100644 --- a/test/language/literals/regexp/7.8.5-1gs.js +++ b/test/language/literals/regexp/7.8.5-1gs.js @@ -9,5 +9,4 @@ negative: type: SyntaxError ---*/ -throw NotEarlyError; var re = //; diff --git a/test/language/literals/string/7.8.4-1gs.js b/test/language/literals/string/7.8.4-1gs.js index 929907e327..d980127141 100644 --- a/test/language/literals/string/7.8.4-1gs.js +++ b/test/language/literals/string/7.8.4-1gs.js @@ -12,5 +12,4 @@ negative: flags: [onlyStrict] ---*/ -throw NotEarlyError; var _7_8_4_2 = '100abc\0110def'; diff --git a/test/language/reserved-words/7.6.1.2-1gs.js b/test/language/reserved-words/7.6.1.2-1gs.js index 2642d13c61..27752445ce 100644 --- a/test/language/reserved-words/7.6.1.2-1gs.js +++ b/test/language/reserved-words/7.6.1.2-1gs.js @@ -12,5 +12,4 @@ negative: flags: [onlyStrict] ---*/ -throw NotEarlyError; var implements = 1; diff --git a/test/language/statements/const/syntax/const-declaring-let-split-across-two-lines.js b/test/language/statements/const/syntax/const-declaring-let-split-across-two-lines.js index 559c283dfb..10fcbf36aa 100644 --- a/test/language/statements/const/syntax/const-declaring-let-split-across-two-lines.js +++ b/test/language/statements/const/syntax/const-declaring-let-split-across-two-lines.js @@ -12,7 +12,6 @@ negative: phase: early type: SyntaxError ---*/ -throw NotEarlyError; const let = "irrelevant initializer"; diff --git a/test/language/statements/function/13.0_4-5gs.js b/test/language/statements/function/13.0_4-5gs.js index 74ca27c4b9..b96877fe6c 100644 --- a/test/language/statements/function/13.0_4-5gs.js +++ b/test/language/statements/function/13.0_4-5gs.js @@ -12,5 +12,4 @@ negative: flags: [onlyStrict] ---*/ -throw NotEarlyError; function _13_0_4_5_fun() { eval = 42; }; diff --git a/test/language/statements/function/13.1-13gs.js b/test/language/statements/function/13.1-13gs.js index 585803950d..9fcafc1c81 100644 --- a/test/language/statements/function/13.1-13gs.js +++ b/test/language/statements/function/13.1-13gs.js @@ -12,5 +12,4 @@ negative: flags: [onlyStrict] ---*/ -throw NotEarlyError; function arguments() { }; diff --git a/test/language/statements/function/13.1-1gs.js b/test/language/statements/function/13.1-1gs.js index 87e05d48a1..021c961c55 100644 --- a/test/language/statements/function/13.1-1gs.js +++ b/test/language/statements/function/13.1-1gs.js @@ -13,5 +13,4 @@ negative: flags: [onlyStrict] ---*/ -throw NotEarlyError; function _13_1_1_fun(eval) { } diff --git a/test/language/statements/function/13.1-4gs.js b/test/language/statements/function/13.1-4gs.js index 8e97c1e13b..0c4549e74a 100644 --- a/test/language/statements/function/13.1-4gs.js +++ b/test/language/statements/function/13.1-4gs.js @@ -13,5 +13,4 @@ negative: flags: [onlyStrict] ---*/ -throw NotEarlyError; var _13_1_4_fun = function (arguments) { }; diff --git a/test/language/statements/function/13.1-5gs.js b/test/language/statements/function/13.1-5gs.js index c274c9503f..4d75685038 100644 --- a/test/language/statements/function/13.1-5gs.js +++ b/test/language/statements/function/13.1-5gs.js @@ -12,5 +12,4 @@ negative: flags: [onlyStrict] ---*/ -throw NotEarlyError; function _13_1_5_fun(param, param) { } diff --git a/test/language/statements/function/13.1-8gs.js b/test/language/statements/function/13.1-8gs.js index b7d6a7a45a..6d61f0a5b9 100644 --- a/test/language/statements/function/13.1-8gs.js +++ b/test/language/statements/function/13.1-8gs.js @@ -12,5 +12,4 @@ negative: flags: [onlyStrict] ---*/ -throw NotEarlyError; var _13_1_8_fun = function (param, param) { }; diff --git a/test/language/statements/let/syntax/let-let-declaration-split-across-two-lines.js b/test/language/statements/let/syntax/let-let-declaration-split-across-two-lines.js index 541dcef355..d8e125be41 100644 --- a/test/language/statements/let/syntax/let-let-declaration-split-across-two-lines.js +++ b/test/language/statements/let/syntax/let-let-declaration-split-across-two-lines.js @@ -26,7 +26,6 @@ negative: phase: early type: SyntaxError ---*/ -throw NotEarlyError; let // start of a LexicalDeclaration, *not* an ASI opportunity let; diff --git a/test/language/statements/let/syntax/let-let-declaration-with-initializer-split-across-two-lines.js b/test/language/statements/let/syntax/let-let-declaration-with-initializer-split-across-two-lines.js index 30b0de237e..54b819933c 100644 --- a/test/language/statements/let/syntax/let-let-declaration-with-initializer-split-across-two-lines.js +++ b/test/language/statements/let/syntax/let-let-declaration-with-initializer-split-across-two-lines.js @@ -26,7 +26,6 @@ negative: phase: early type: SyntaxError ---*/ -throw NotEarlyError; let // start of a LexicalDeclaration, *not* an ASI opportunity let = "irrelevant initializer"; diff --git a/test/language/statements/try/12.14.1-1gs.js b/test/language/statements/try/12.14.1-1gs.js index a575377fd7..c706ed07b0 100644 --- a/test/language/statements/try/12.14.1-1gs.js +++ b/test/language/statements/try/12.14.1-1gs.js @@ -13,5 +13,4 @@ negative: flags: [onlyStrict] ---*/ -throw NotEarlyError; try { } catch (eval) { } diff --git a/test/language/statements/variable/12.2.1-1gs.js b/test/language/statements/variable/12.2.1-1gs.js index b1047b29de..d4dd0a6bdb 100644 --- a/test/language/statements/variable/12.2.1-1gs.js +++ b/test/language/statements/variable/12.2.1-1gs.js @@ -12,5 +12,4 @@ negative: flags: [onlyStrict] ---*/ -throw NotEarlyError; for (var eval in arrObj) { } diff --git a/test/language/statements/variable/12.2.1-4gs.js b/test/language/statements/variable/12.2.1-4gs.js index 58a0a7b38d..fd7a19977a 100644 --- a/test/language/statements/variable/12.2.1-4gs.js +++ b/test/language/statements/variable/12.2.1-4gs.js @@ -12,5 +12,4 @@ negative: flags: [onlyStrict] ---*/ -throw NotEarlyError; var arguments; diff --git a/test/language/statements/with/12.10.1-11gs.js b/test/language/statements/with/12.10.1-11gs.js index cb2f432d8a..996698c6bc 100644 --- a/test/language/statements/with/12.10.1-11gs.js +++ b/test/language/statements/with/12.10.1-11gs.js @@ -10,5 +10,4 @@ negative: flags: [onlyStrict] ---*/ -throw NotEarlyError; with ({}) { }