diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 53ec851c4aeba68d1a1780a8155e36c7e1225a87..76f1972a34f0910c68961dd9905de11b24e8e1f3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -163,7 +163,7 @@ This tag is for boolean properties associated with the test. #### features **features**: [list] -Some tests require the use of language features that are not directly described by the test file's location in the directory structure. These features should be specified with this tag. See the `features.txt` file for a complete list of available values. This tag is required for new tests written for new features, but contributions will not be "blocked" if the tag is missing from frontmatter. The committing maintainer is required to ensure that the tag is present and contains the correct feature names; this can be done in an follow up commit. +Some tests require the use of language features that are not directly described by the test file's location in the directory structure. These features should be specified with this tag. See the `features.txt` file for a complete list of available values. This tag is required for new tests written for new features, but contributions will not be "blocked" if the tag is missing from frontmatter. The committing maintainer is required to ensure that the tag is present and contains the correct feature names; this can be done in an follow up commit. #### es5id **es5id**: [es5-test-id] @@ -195,7 +195,6 @@ assert(value, message) | throw a new Test262Error instance if the specified valu assert.sameValue(actual, expected, message) | throw a new Test262Error instance if the first two arguments are not [the same value](https://tc39.github.io/ecma262/#sec-samevalue); accepts an optional string message for use in creating the error assert.notSameValue(actual, unexpected, message) | throw a new Test262Error instance if the first two arguments are [the same value](https://tc39.github.io/ecma262/#sec-samevalue); accepts an optional string message for use in creating the error assert.throws(expectedErrorConstructor, fn, message) | 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 -assert.throws.early(expectedErrorConstructor, code) | throw a new Test262Error instance if the provided code does not throw an early error, or if the constructor of the value thrown does not match the provided constructor. This assertion catches only errors that will be parsed through `Function(code)`. $ERROR(message) | construct a Test262Error object and throw it <br>**DEPRECATED** -- Do not use in new tests. Use `assert`, `assert.*`, or `throw new Test262Error` instead. ``` diff --git a/harness/assert.js b/harness/assert.js index 5fbc12254106940016c47fa72cba23af6d706fd7..58e98e37b720770099a90e32b39dd19eb6cf22f7 100644 --- a/harness/assert.js +++ b/harness/assert.js @@ -86,10 +86,3 @@ assert.throws = function (expectedErrorConstructor, func, message) { message += 'Expected a ' + expectedErrorConstructor.name + ' to be thrown but no exception was thrown at all'; $ERROR(message); }; - -assert.throws.early = function(err, code) { - var wrappedCode = 'function wrapperFn() { ' + code + ' }'; - var ieval = eval; - - assert.throws(err, function() { Function(wrappedCode); }, 'Function: ' + code); -}; diff --git a/test/harness/assert-throws-early-incorrect-ctor.js b/test/harness/assert-throws-early-incorrect-ctor.js deleted file mode 100644 index c291c930a527d27b047e984d296ce247ba045e6f..0000000000000000000000000000000000000000 --- a/test/harness/assert-throws-early-incorrect-ctor.js +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2017 Mozilla Corporation. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -description: > - Functions that throw values whose constructor does not match the specified - constructor do not satisfy the assertion. ----*/ - -// monkeypatch the API -$ERROR = function $ERROR(message) { - throw new Test262Error(message); -}; - -assert.throws(Test262Error, () => { - assert.throws.early(SyntaxError, "1 = 1;"); -}, "'1=1' is a ReferenceError"); -assert.throws(Test262Error, () => { - assert.throws.early(ReferenceError, "var;"); -}, "'var;' is a SyntaxError"); diff --git a/test/harness/assert-throws-early-not-early.js b/test/harness/assert-throws-early-not-early.js deleted file mode 100644 index f7b721fe6141b339e85c9318185bf7766fea7bf9..0000000000000000000000000000000000000000 --- a/test/harness/assert-throws-early-not-early.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (C) 2017 Mozilla Corporation. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -description: > - The assertion fails when the code does not parse with an early error -includes: [sta.js] ----*/ -assert.throws(Test262Error, () => { - assert.throws.early(ReferenceError, 'x = 1'); -}); diff --git a/test/harness/assert-throws-early-referenceerror.js b/test/harness/assert-throws-early-referenceerror.js deleted file mode 100644 index fbb667f1cb6b934848e8b43eee9add58ef0d1cd2..0000000000000000000000000000000000000000 --- a/test/harness/assert-throws-early-referenceerror.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (C) 2017 Mozilla Corporation. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -description: > - The assertion pass when the code parses with an early ReferenceError ----*/ - -assert.throws.early(ReferenceError, '1 = 1;'); diff --git a/test/harness/assert-throws-early-syntaxerror.js b/test/harness/assert-throws-early-syntaxerror.js deleted file mode 100644 index 0e047d0f0f81c82518fc99f86cf484410bb007a7..0000000000000000000000000000000000000000 --- a/test/harness/assert-throws-early-syntaxerror.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (C) 2017 Mozilla Corporation. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -description: > - The assertion pass when the code parses with an early SyntaxError ----*/ - -assert.throws.early(SyntaxError, 'let let');