Bug 1185106 - Part 11.4: Add function length test for async function. r=till draft
authorTooru Fujisawa <arai_a@mac.com>
Mon, 29 Aug 2016 02:06:19 +0900
changeset 430949 a14def6ea642dea7a71c7314c93f70657aac525a
parent 430948 ef39283242084d573148fce168a69ce274c3d379
child 430950 833a7b8c298bcacc012458432f484133e971e1d4
push id33945
push userarai_a@mac.com
push dateFri, 28 Oct 2016 11:34:02 +0000
reviewerstill
bugs1185106
milestone52.0a1
Bug 1185106 - Part 11.4: Add function length test for async function. r=till MozReview-Commit-ID: BILq634dpL2
js/src/tests/ecma_7/AsyncFunctions/length.js
new file mode 100644
--- /dev/null
+++ b/js/src/tests/ecma_7/AsyncFunctions/length.js
@@ -0,0 +1,19 @@
+var BUGNUMBER = 1185106;
+var summary = "async function length";
+
+print(BUGNUMBER + ": " + summary);
+
+var test = `
+
+assertEq(async function() {}.length, 0);
+assertEq(async function(a) {}.length, 1);
+assertEq(async function(a, b, c) {}.length, 3);
+assertEq(async function(a, b, c, ...d) {}.length, 3);
+
+`;
+
+if (asyncFunctionsEnabled())
+    eval(test);
+
+if (typeof reportCompare === "function")
+    reportCompare(true, true);