Bug 1185106 - Part 11.6: Add test for async function expression binding identity. r=till draft
authorTooru Fujisawa <arai_a@mac.com>
Mon, 29 Aug 2016 14:51:10 +0900
changeset 430951 37bce14e7c4840dba90256f4f7fe1575ca226733
parent 430950 833a7b8c298bcacc012458432f484133e971e1d4
child 430952 a7c44d9903840446541b0e50ce916b651f643b9d
push id33945
push userarai_a@mac.com
push dateFri, 28 Oct 2016 11:34:02 +0000
reviewerstill
bugs1185106
milestone52.0a1
Bug 1185106 - Part 11.6: Add test for async function expression binding identity. r=till MozReview-Commit-ID: J7YAj7XIh24
js/src/tests/ecma_7/AsyncFunctions/identity.js
new file mode 100644
--- /dev/null
+++ b/js/src/tests/ecma_7/AsyncFunctions/identity.js
@@ -0,0 +1,21 @@
+// |reftest| skip-if(!xulRuntime.shell) -- needs drainJobQueue
+
+var BUGNUMBER = 1185106;
+var summary = "Named async function expression should get wrapped function for the name inside it";
+
+print(BUGNUMBER + ": " + summary);
+
+var test = `
+
+var expr = async function foo() {
+  return foo;
+};
+assertEventuallyEq(expr(), expr);
+
+`;
+
+if (asyncFunctionsEnabled())
+    eval(test);
+
+if (typeof reportCompare === "function")
+    reportCompare(true, true);