summaryrefslogtreecommitdiff
path: root/js/src/tests
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-20 10:46:22 +0100
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-20 10:46:22 +0100
commit9b488c7cffa2da0816cae4d7a884a193ebab2341 (patch)
treee871716443289e196226c2f40c3a31b09904efb1 /js/src/tests
parent1664c8df00bff646617feeec2f6bd16f331caf3b (diff)
downloaduxp-9b488c7cffa2da0816cae4d7a884a193ebab2341.tar.gz
Bug 1322314 - Do not emit ParseNode twice in BytecodeEmitter::emitDestructuringOpsArray
Issue mcp-graveyard/UXP#73 [Depends on] Bug 1147371: Implement IteratorClose
Diffstat (limited to 'js/src/tests')
-rw-r--r--js/src/tests/ecma_6/Destructuring/array-default-class.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/tests/ecma_6/Destructuring/array-default-class.js b/js/src/tests/ecma_6/Destructuring/array-default-class.js
new file mode 100644
index 0000000000..5aa9c579b1
--- /dev/null
+++ b/js/src/tests/ecma_6/Destructuring/array-default-class.js
@@ -0,0 +1,25 @@
+var BUGNUMBER = 1322314;
+var summary = "Function in computed property in class expression in array destructuring default";
+
+print(BUGNUMBER + ": " + summary);
+
+function* g([
+ a = class E {
+ [ (function() { return "foo"; })() ]() {
+ return 10;
+ }
+ }
+]) {
+ yield a;
+}
+
+let C = [...g([])][0];
+let x = new C();
+assertEq(x.foo(), 10);
+
+C = [...g([undefined])][0];
+x = new C();
+assertEq(x.foo(), 10);
+
+if (typeof reportCompare === "function")
+ reportCompare(0, 0);