From cfe59eec6498614d7bd5c054cf173b18af75eb72 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Wed, 24 Apr 2019 10:59:54 -0400 Subject: [PATCH] INTERPRETING.md/CONTRIBUTING.md: revised rules for _FIXTURE.js files (#2135) --- CONTRIBUTING.md | 7 +++++++ INTERPRETING.md | 6 +----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6501782996..6eb2b0ffbe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -234,6 +234,13 @@ function Test262Error(message) { } ``` +## Rules For Module `_FIXTURE.js` Files + +The [Module section of INTERPRETING.md](https://github.com/tc39/test262/blob/master/INTERPRETING.md#modules) states that `_FIXTURE.js` files will not have have Realm modifications applied. In practice, this means that code in `_FIXTURE.js` files must abide by the following rules: + +- **MUST NOT** refer to, or make use of any [Test262-Defined Bindings](https://github.com/tc39/test262/blob/master/INTERPRETING.md#test262-defined-bindings) in any way. +- **MUST NOT** refer to, or make use of any [Host-Defined Functions](https://github.com/tc39/test262/blob/master/INTERPRETING.md#host-defined-functions) in any way. + ## Handling Errors and Negative Test Cases Expectations for **parsing errors** should be declared using [the `negative` frontmatter flag](#negative). They must also include `$DONOTEVALUATE();` (in order to guarantee that implementations do not execute the code): diff --git a/INTERPRETING.md b/INTERPRETING.md index 87232a4e33..e55b84e99d 100644 --- a/INTERPRETING.md +++ b/INTERPRETING.md @@ -135,11 +135,7 @@ This must precede any additional text modifications described by test metadata. ### Modules Test262 includes tests for ECMAScript 2015 module code, denoted by the "module" -metadata flag. Files bearing a name ending in `_FIXTURE.js`: - -- **MUST NOT** be interpreted as standalone tests; they are intended to be referenced by test files. -- **MUST NOT** refer to, or make use of any [Test262-Defined Bindings](#test262-defined-bindings) in any way. -- **MUST NOT** refer to, or make use of any [Host-Defined Functions](#host-defined-functions) in any way. +metadata flag. Files bearing a name ending in `_FIXTURE.js` **MUST NOT** be interpreted as standalone tests; they are intended to be referenced by test files. Realm modifications, including [Test262-Defined Bindings](#test262-defined-bindings) and [Host-Defined Functions](#host-defined-functions), are not applied to code executed from `_FIXTURE.js` files. See the [**Rules For Module `_FIXTURE.js` Files** section of CONTRIBUTING.md](https://github.com/tc39/test262/blob/master/CONTRIBUTING.md#rules-for-module-fixturejs-files) for more information. All module specifiers used by Test262 begin with the character sequence `./`. The remaining characters should be interpreted as the name of a file within the