Bug 1185106 - Part 8.2: Add parser test for await in module. r=efaust,till
authorTooru Fujisawa <arai_a@mac.com>
Sun, 28 Aug 2016 23:58:29 +0900
changeset 320239 92f7082a90be77700618e8176c73ad7538ee75a3
parent 320238 0f59ff767344e7856642447f5e9a3679cc2fe4ab
child 320240 0e9b413f34392cd8e1bdda5cb230091a204fb5ef
push id20754
push usercbook@mozilla.com
push dateMon, 31 Oct 2016 15:58:35 +0000
treeherderfx-team@b1b66b1780c2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersefaust, till
bugs1185106
milestone52.0a1
Bug 1185106 - Part 8.2: Add parser test for await in module. r=efaust,till MozReview-Commit-ID: JNEYt4Y3fo4
js/src/tests/ecma_7/AsyncFunctions/syntax-modules.js
new file mode 100644
--- /dev/null
+++ b/js/src/tests/ecma_7/AsyncFunctions/syntax-modules.js
@@ -0,0 +1,15 @@
+var BUGNUMBER = 1185106;
+var summary = "async/await syntax in module";
+
+print(BUGNUMBER + ": " + summary);
+
+if (typeof parseModule === "function") {
+    parseModule("async function f() { await 3; }");
+    parseModule("async function f() { await 3; }");
+    assertThrows(() => parseModule("var await = 5;"), SyntaxError);
+    assertThrows(() => parseModule("export var await;"), SyntaxError);
+    assertThrows(() => parseModule("async function f() { function g() { await 3; } }"), SyntaxError);
+}
+
+if (typeof reportCompare === "function")
+    reportCompare(true, true);