summaryrefslogtreecommitdiffstats
path: root/js/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests')
-rw-r--r--js/src/tests/ecma_2017/AsyncFunctions/inner-caller.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/js/src/tests/ecma_2017/AsyncFunctions/inner-caller.js b/js/src/tests/ecma_2017/AsyncFunctions/inner-caller.js
new file mode 100644
index 000000000..523eb79ea
--- /dev/null
+++ b/js/src/tests/ecma_2017/AsyncFunctions/inner-caller.js
@@ -0,0 +1,26 @@
+var BUGNUMBER = 1185106;
+var summary = "caller property of function inside async function should return wrapped async function";
+
+print(BUGNUMBER + ": " + summary);
+
+(async function f() {
+ var inner = (function g() {
+ return g.caller;
+ })();
+ assertEq(inner, f);
+})();
+
+(async function f() {
+ "use strict";
+ try {
+ (function g() {
+ return g.caller;
+ })();
+ assertEq(true, false);
+ } catch (e) {
+ assertEq(e instanceof TypeError, true);
+ }
+})();
+
+if (typeof reportCompare === "function")
+ reportCompare(true, true);