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.
This commit is contained in:
Mike Pennisi 2016-03-13 13:21:02 -04:00
parent 0d4a07ba8c
commit ade6d2e384
27 changed files with 2 additions and 42 deletions

View File

@ -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;
```

View File

@ -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 || "";
}

View File

@ -10,7 +10,6 @@ negative:
flags: [onlyStrict]
---*/
throw NotEarlyError;
function f_10_5_1_gs(){
arguments = 7;

View File

@ -14,5 +14,4 @@ flags: [raw]
"use strict";
"use strict";
throw NotEarlyError;
var public = 1;

View File

@ -13,5 +13,4 @@ flags: [onlyStrict]
---*/
var _11_4_1_5 = 7;
throw NotEarlyError;
delete _11_4_1_5;

View File

@ -13,5 +13,4 @@ negative:
flags: [onlyStrict]
---*/
throw NotEarlyError;
var obj = { set _11_1_5_1_fun(eval) {}};

View File

@ -12,5 +12,4 @@ negative:
flags: [onlyStrict]
---*/
throw NotEarlyError;
arguments++;

View File

@ -12,5 +12,4 @@ negative:
flags: [onlyStrict]
---*/
throw NotEarlyError;
--arguments;

View File

@ -8,6 +8,5 @@ flags: [onlyStrict]
---*/
"use strict";
if (this===undefined) {
throw NotEarlyError;
}
assert.notSameValue(this, undefined);

View File

@ -10,5 +10,4 @@ negative:
flags: [onlyStrict]
---*/
throw NotEarlyError;
var y = 010;

View File

@ -12,7 +12,6 @@ negative:
flags: [onlyStrict]
---*/
throw NotEarlyError;
var a;
a = 0x1;
a = 01;

View File

@ -9,5 +9,4 @@ negative:
type: SyntaxError
---*/
throw NotEarlyError;
var re = //;

View File

@ -12,5 +12,4 @@ negative:
flags: [onlyStrict]
---*/
throw NotEarlyError;
var _7_8_4_2 = '100abc\0110def';

View File

@ -12,5 +12,4 @@ negative:
flags: [onlyStrict]
---*/
throw NotEarlyError;
var implements = 1;

View File

@ -12,7 +12,6 @@ negative:
phase: early
type: SyntaxError
---*/
throw NotEarlyError;
const
let = "irrelevant initializer";

View File

@ -12,5 +12,4 @@ negative:
flags: [onlyStrict]
---*/
throw NotEarlyError;
function _13_0_4_5_fun() { eval = 42; };

View File

@ -12,5 +12,4 @@ negative:
flags: [onlyStrict]
---*/
throw NotEarlyError;
function arguments() { };

View File

@ -13,5 +13,4 @@ negative:
flags: [onlyStrict]
---*/
throw NotEarlyError;
function _13_1_1_fun(eval) { }

View File

@ -13,5 +13,4 @@ negative:
flags: [onlyStrict]
---*/
throw NotEarlyError;
var _13_1_4_fun = function (arguments) { };

View File

@ -12,5 +12,4 @@ negative:
flags: [onlyStrict]
---*/
throw NotEarlyError;
function _13_1_5_fun(param, param) { }

View File

@ -12,5 +12,4 @@ negative:
flags: [onlyStrict]
---*/
throw NotEarlyError;
var _13_1_8_fun = function (param, param) { };

View File

@ -26,7 +26,6 @@ negative:
phase: early
type: SyntaxError
---*/
throw NotEarlyError;
let // start of a LexicalDeclaration, *not* an ASI opportunity
let;

View File

@ -26,7 +26,6 @@ negative:
phase: early
type: SyntaxError
---*/
throw NotEarlyError;
let // start of a LexicalDeclaration, *not* an ASI opportunity
let = "irrelevant initializer";

View File

@ -13,5 +13,4 @@ negative:
flags: [onlyStrict]
---*/
throw NotEarlyError;
try { } catch (eval) { }

View File

@ -12,5 +12,4 @@ negative:
flags: [onlyStrict]
---*/
throw NotEarlyError;
for (var eval in arrObj) { }

View File

@ -12,5 +12,4 @@ negative:
flags: [onlyStrict]
---*/
throw NotEarlyError;
var arguments;

View File

@ -10,5 +10,4 @@ negative:
flags: [onlyStrict]
---*/
throw NotEarlyError;
with ({}) { }