Skip to content
Snippets Groups Projects
Commit e6d674ef authored by Mike Pennisi's avatar Mike Pennisi Committed by Rick Waldron
Browse files

Rename negative test "phase" for module resolution

parent 13611037
Branches
No related tags found
No related merge requests found
Showing
with 56 additions and 10 deletions
......@@ -103,7 +103,7 @@ single line comment syntax.
This means the test is expected to throw an error of the given type. If no error is thrown, a test failure is reported.
- **type**- If an error is thrown, it is implicitly converted to a string. In order for the test to pass, this value must match the name of the error constructor.
- **phase** - Negative tests whose **phase** value is "parse" must produce the specified error prior to executing code. The value "runtime" dictates that the error is expected to be produced as a result of executing the test code.
- **phase** - Negative tests whose **phase** value is "parse" must produce the specified error prior to executing code. The value "resolution" indicates that the error is expected to result while performing ES2015 module resolution. The value "runtime" dictates that the error is expected to be produced as a result of executing the test code.
For best practices on how to use the negative tag please see [Handling Errors and Negative Test Cases](#handling-errors-and-negative-test-cases), below.
......
......@@ -162,8 +162,9 @@ attribute is a YAML dictonary with two keys:
- `phase` - the stage of the test interpretation process that the error is
expected to be produced; either "parse" (meaning, "while parsing the source
text"), "early" (meaning, "prior to evaluation") or "runtime" (meaning,
"during evaluation")
text"), "early" (meaning, "prior to evaluation"), "resolution" (meaining,
"during ES2015 module resolution"), or "runtime" (meaning, "during
evaluation")
- `type` - the name of the constructor of the expected error
If a test configured with the `negative` attribute completes without throwing
......
......@@ -30,7 +30,7 @@ info: |
{ ExportsList }
{ ExportsList , }
negative:
phase: early
phase: resolution
type: ReferenceError
flags: [module]
---*/
......
......@@ -36,7 +36,7 @@ info: |
{ ImportsList }
{ ImportsList , }
negative:
phase: early
phase: resolution
type: ReferenceError
flags: [module]
---*/
......
......@@ -11,7 +11,7 @@ info: |
b. Let requiredModule be ? HostResolveImportedModule(module, required).
[...]
negative:
phase: early
phase: resolution
type: ReferenceError
flags: [module]
---*/
......
......@@ -11,7 +11,7 @@ info: |
b. Let requiredModule be ? HostResolveImportedModule(module, required).
[...]
negative:
phase: early
phase: resolution
type: SyntaxError
flags: [module]
---*/
......
......@@ -4,7 +4,7 @@
description: Module dependencies are resolved following a depth-first strategy
esid: sec-moduledeclarationinstantiation
negative:
phase: early
phase: resolution
type: ReferenceError
flags: [module]
---*/
......
......@@ -4,7 +4,7 @@
description: Modules dependencies are resolved in source text order
esid: sec-moduledeclarationinstantiation
negative:
phase: early
phase: resolution
type: ReferenceError
flags: [module]
---*/
......
......@@ -23,5 +23,5 @@ class CheckNegative(Check):
if not 'phase' in negative:
return '"negative" must specify a "phase" field'
if negative["phase"] == "parse" and not _THROW_STMT.search(source):
if negative["phase"] in ["parse", "resolution"] and not _THROW_STMT.search(source):
return 'Negative tests of type "early" must include a `throw` statement'
NEGATIVE
^ expected errors | v input
// Copyright (C) 2017 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-assignment-operators-static-semantics-early-errors
description: Minimal test
flags: [module]
negative:
type: SyntaxError
phase: resolution
---*/
throw "Test262: This statement should not be evaluated!";
import 'non-existent-module.js';
NEGATIVE
^ expected errors | v input
// Copyright (C) 2017 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-assignment-operators-static-semantics-early-errors
description: Minimal test
flags: [module]
negative:
type: SyntaxError
phase: resolution
---*/
import 'non-existent-module.js';
^ expected errors | v input
// Copyright (C) 2017 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-assignment-operators-static-semantics-early-errors
description: Minimal test
flags: [module]
negative:
type: SyntaxError
phase: resolution
---*/
throw "Test262: This statement should not be evaluated.";
import 'non-existent-module.js';
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment