diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2019-06-08 14:51:46 -0400 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2019-07-18 22:38:14 -0400 |
commit | 7ecc50d90d13690d610f26d0056a326e52bc834c (patch) | |
tree | 18e5e9248a8011e44de84cb8b73f77f9027d0dd6 /js/src/tests/ecma_6 | |
parent | 987d6726f3c64d1cc510acba1de08deb5e0a7702 (diff) | |
download | uxp-7ecc50d90d13690d610f26d0056a326e52bc834c.tar.gz |
1317379 - Disallow generator functions and async functions as direct children of if/else.
Diffstat (limited to 'js/src/tests/ecma_6')
-rw-r--r-- | js/src/tests/ecma_6/Generators/forbidden-as-consequent.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/js/src/tests/ecma_6/Generators/forbidden-as-consequent.js b/js/src/tests/ecma_6/Generators/forbidden-as-consequent.js new file mode 100644 index 0000000000..13647e154b --- /dev/null +++ b/js/src/tests/ecma_6/Generators/forbidden-as-consequent.js @@ -0,0 +1,11 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +assertThrowsInstanceOf(() => eval("if (1) function* foo() {}"), + SyntaxError); +assertThrowsInstanceOf(() => eval("'use strict'; if (1) function* foo() {}"), + SyntaxError); + +if (typeof reportCompare === "function") + reportCompare(true, true); |