summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-06-09 22:35:15 -0400
committerGaming4JC <g4jc@hyperbola.info>2019-07-18 22:38:38 -0400
commit64fd7ae4546424c42a9e2022e05b83379411109a (patch)
tree54ab581c56d53d80d20b95bacbb8f8e02b977138 /js/src/jit-test/tests
parentd2aa017a88a4b918ded2159cd202ce6c7c7218d0 (diff)
downloadUXP-64fd7ae4546424c42a9e2022e05b83379411109a.tar
UXP-64fd7ae4546424c42a9e2022e05b83379411109a.tar.gz
UXP-64fd7ae4546424c42a9e2022e05b83379411109a.tar.lz
UXP-64fd7ae4546424c42a9e2022e05b83379411109a.tar.xz
UXP-64fd7ae4546424c42a9e2022e05b83379411109a.zip
1339963 - Part 3: Check IdentifierName in ExportClause without from.
Diffstat (limited to 'js/src/jit-test/tests')
-rw-r--r--js/src/jit-test/tests/modules/export-declaration.js46
1 files changed, 44 insertions, 2 deletions
diff --git a/js/src/jit-test/tests/modules/export-declaration.js b/js/src/jit-test/tests/modules/export-declaration.js
index 48d1072bf..9925f2c68 100644
--- a/js/src/jit-test/tests/modules/export-declaration.js
+++ b/js/src/jit-test/tests/modules/export-declaration.js
@@ -403,10 +403,52 @@ assertThrowsInstanceOf(function() {
parseAsModule("export {,} from 'a'");
}, SyntaxError);
-parseAsModule("export { true as a } from 'b'");
+program([
+ exportDeclaration(
+ null,
+ [
+ exportSpecifier(
+ ident("true"),
+ ident("true")
+ ),
+ ],
+ lit("b"),
+ false
+ )
+]).assert(parseAsModule("export { true } from 'b'"));
+
+program([
+ exportDeclaration(
+ null,
+ [
+ exportSpecifier(
+ ident("true"),
+ ident("name")
+ ),
+ ],
+ lit("b"),
+ false
+ )
+]).assert(parseAsModule("export { true as name } from 'b'"));
+
+assertThrowsInstanceOf(function() {
+ parseAsModule("export { true }");
+}, SyntaxError);
+
+assertThrowsInstanceOf(function() {
+ parseAsModule("export { true as name }");
+}, SyntaxError);
+
+assertThrowsInstanceOf(function() {
+ parseAsModule("export { static }");
+}, SyntaxError);
+
+assertThrowsInstanceOf(function() {
+ parseAsModule("export { static as name }");
+}, SyntaxError);
assertThrowsInstanceOf(function () {
- parseAsModule("export { a } from 'b' f();");
+ parseAsModule("export { name } from 'b' f();");
}, SyntaxError);
assertThrowsInstanceOf(function () {