diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2019-06-08 16:16:14 -0400 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2019-07-18 22:38:18 -0400 |
commit | af32c8553e54455ef8cbfe70a13f79f84c2163a4 (patch) | |
tree | fb43f83a507102c33a9631f3a7d9a2a156024545 /js/src/tests/ecma_2017 | |
parent | c6fe42095040b0be2ee85bc750bd905bfe396fbd (diff) | |
download | UXP-af32c8553e54455ef8cbfe70a13f79f84c2163a4.tar UXP-af32c8553e54455ef8cbfe70a13f79f84c2163a4.tar.gz UXP-af32c8553e54455ef8cbfe70a13f79f84c2163a4.tar.lz UXP-af32c8553e54455ef8cbfe70a13f79f84c2163a4.tar.xz UXP-af32c8553e54455ef8cbfe70a13f79f84c2163a4.zip |
1325606 - Return wrapped async function from caller property.
Diffstat (limited to 'js/src/tests/ecma_2017')
-rw-r--r-- | js/src/tests/ecma_2017/AsyncFunctions/inner-caller.js | 26 |
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); |