diff options
Diffstat (limited to 'js/src/tests/test/fixtures/export')
-rw-r--r-- | js/src/tests/test/fixtures/export/.ignore.js | 1 | ||||
-rw-r--r-- | js/src/tests/test/fixtures/export/browser.js | 1 | ||||
-rw-r--r-- | js/src/tests/test/fixtures/export/empty.js | 0 | ||||
-rw-r--r-- | js/src/tests/test/fixtures/export/multi-header.js | 20 | ||||
-rw-r--r-- | js/src/tests/test/fixtures/export/reftest-and-frontmatter-error.js | 19 | ||||
-rw-r--r-- | js/src/tests/test/fixtures/export/reftest-error-syntaxerror.js | 15 | ||||
-rw-r--r-- | js/src/tests/test/fixtures/export/regular.js | 18 | ||||
-rw-r--r-- | js/src/tests/test/fixtures/export/reportCompare.js | 38 | ||||
-rw-r--r-- | js/src/tests/test/fixtures/export/shell.js | 1 |
9 files changed, 113 insertions, 0 deletions
diff --git a/js/src/tests/test/fixtures/export/.ignore.js b/js/src/tests/test/fixtures/export/.ignore.js new file mode 100644 index 0000000000..945c9b46d6 --- /dev/null +++ b/js/src/tests/test/fixtures/export/.ignore.js @@ -0,0 +1 @@ +.
\ No newline at end of file diff --git a/js/src/tests/test/fixtures/export/browser.js b/js/src/tests/test/fixtures/export/browser.js new file mode 100644 index 0000000000..d18a19cb28 --- /dev/null +++ b/js/src/tests/test/fixtures/export/browser.js @@ -0,0 +1 @@ +// not an empty file diff --git a/js/src/tests/test/fixtures/export/empty.js b/js/src/tests/test/fixtures/export/empty.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test/fixtures/export/empty.js diff --git a/js/src/tests/test/fixtures/export/multi-header.js b/js/src/tests/test/fixtures/export/multi-header.js new file mode 100644 index 0000000000..c1f46f4e4f --- /dev/null +++ b/js/src/tests/test/fixtures/export/multi-header.js @@ -0,0 +1,20 @@ +// |reftest| skip-if(!this.hasOwnProperty('foobar')||outro()) error:SyntaxError module -- foo bar baz +// Copyright (C) 2017 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Jeff Walden <jwalden+code@mit.edu> +esid: sec-let-and-const-declarations +description: > + Outside AsyncFunction, |await| is a perfectly cromulent LexicalDeclaration + variable name. Therefore ASI doesn't apply, and so the |0| where a |=| was + expected is a syntax error. +negative: + phase: early + type: SyntaxError +---*/ + +function f() { + let + await 0; +} diff --git a/js/src/tests/test/fixtures/export/reftest-and-frontmatter-error.js b/js/src/tests/test/fixtures/export/reftest-and-frontmatter-error.js new file mode 100644 index 0000000000..38e98283d7 --- /dev/null +++ b/js/src/tests/test/fixtures/export/reftest-and-frontmatter-error.js @@ -0,0 +1,19 @@ +// |reftest| error:SyntaxError + +/*--- +esid: sec-let-and-const-declarations +description: > + Outside AsyncFunction, |await| is a perfectly cromulent LexicalDeclaration + variable name. Therefore ASI doesn't apply, and so the |0| where a |=| was + expected is a syntax error. +negative: + phase: runtime + type: SyntaxError +---*/ + +eval(` + function f() { + let + await 0; + } +`); diff --git a/js/src/tests/test/fixtures/export/reftest-error-syntaxerror.js b/js/src/tests/test/fixtures/export/reftest-error-syntaxerror.js new file mode 100644 index 0000000000..718778ddf7 --- /dev/null +++ b/js/src/tests/test/fixtures/export/reftest-error-syntaxerror.js @@ -0,0 +1,15 @@ +// |reftest| error:SyntaxError + +/*--- +author: Jeff Walden <jwalden+code@mit.edu> +esid: sec-let-and-const-declarations +description: > + Outside AsyncFunction, |await| is a perfectly cromulent LexicalDeclaration + variable name. Therefore ASI doesn't apply, and so the |0| where a |=| was + expected is a syntax error. +---*/ + +function f() { + let + await 0; +} diff --git a/js/src/tests/test/fixtures/export/regular.js b/js/src/tests/test/fixtures/export/regular.js new file mode 100644 index 0000000000..c43a5b2745 --- /dev/null +++ b/js/src/tests/test/fixtures/export/regular.js @@ -0,0 +1,18 @@ +// Copyright (C) 2017 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Jeff Walden <jwalden+code@mit.edu> +esid: sec-let-and-const-declarations +description: > + |await| is excluded from LexicalDeclaration by grammar parameter, in + AsyncFunction. Therefore |let| followed by |await| inside AsyncFunction is + an ASI opportunity, and this code must parse without error. +---*/ + +async function f() { + let + await 0; +} + +reportCompare(true, f instanceof Function); diff --git a/js/src/tests/test/fixtures/export/reportCompare.js b/js/src/tests/test/fixtures/export/reportCompare.js new file mode 100644 index 0000000000..7b5af60053 --- /dev/null +++ b/js/src/tests/test/fixtures/export/reportCompare.js @@ -0,0 +1,38 @@ +// Copyright (C) 2017 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: reportCompare +---*/ + + +var a = 42; + +reportCompare(0, 0) +reportCompare(0, 0); +reportCompare(0, 0, "ok") +reportCompare(true, true, "ok"); // comment +reportCompare(trueish, true, "ok"); + +reportCompare ( 0 , 0 ) ; +reportCompare ( 0 , 0, "ok") +reportCompare ( true, /*lol*/true, "ok"); + +reportCompare(null, null, "test"); +reportCompare(true, f instanceof Function); +reportCompare(true, true) +reportCompare(true, true); +reportCompare(true, true, "don't crash"); +reportCompare(true,true); +this.reportCompare && reportCompare(0, 0, "ok"); +this.reportCompare && reportCompare(true, true); +this.reportCompare && reportCompare(true,true); + +reportCompare(42, foo); + + reportCompare(0, 0); // this was a reportCompare Line + +reportCompare( + true, + true +); diff --git a/js/src/tests/test/fixtures/export/shell.js b/js/src/tests/test/fixtures/export/shell.js new file mode 100644 index 0000000000..d18a19cb28 --- /dev/null +++ b/js/src/tests/test/fixtures/export/shell.js @@ -0,0 +1 @@ +// not an empty file |