aboutsummaryrefslogtreecommitdiffstats
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorMike Pennisi <mike@mikepennisi.com>2017-04-29 15:33:06 -0400
committerRick Waldron <waldron.rick@gmail.com>2017-06-28 11:24:36 -0400
commit53842533b79e429dc3efca258221587c9aec06e6 (patch)
tree95d0b50aae9342774ccae75f8349b52b6ef3cc4d /CONTRIBUTING.md
parentef76e548a4baa456f3a2ba1b7221f38b89906f9c (diff)
Enforce use of `throw` stmt in early error tests
Previously, test consumers were encouraged to insert a `throw` statement as the first statement of tests for early errors. This recommendation made tests harder to consume, and as an optional transformation, consumers may have ignored it or simply been unaware it was made. By explicitly including such a `throw` statement, the tests become more literal, making them easier to consume and more transparent in their expectations. Document expectation for all tests for early errors to include an explicit `throw` statement. Extend linting script to verify that contributors are automatically notified of violations and to ensure that future contributions satisfy this expectation.
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index fcbd0e85e..584ddb3ed 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -187,7 +187,7 @@ function $DONE(arg) {
## Handling Errors and Negative Test Cases
-Expectations for **parsing errors** should be declared using [the `negative` frontmatter flag](#negative):
+Expectations for **parsing errors** should be declared using [the `negative` frontmatter flag](#negative). They must also include the exact `throw` statement specified in this example (in order to guarantee that implementations do not execute the code):
```javascript
/*---
@@ -196,6 +196,8 @@ negative:
type: SyntaxError
---*/
+throw "Test262: This statement should not be evaluated.";
+
var var = var;
```