diff --git a/mozilla/js/rhino/testsrc/jstests/destructuringLvalue.jstest b/mozilla/js/rhino/testsrc/jstests/destructuringLvalue.jstest new file mode 100644 index 00000000000..ed4993524c3 --- /dev/null +++ b/mozilla/js/rhino/testsrc/jstests/destructuringLvalue.jstest @@ -0,0 +1,12 @@ +var obj = { p:3 }; +var arr = [ 3 ]; +[obj.p] = [9]; +if (obj.p != 9) throw "obj.p not set by array destructuring assignment"; +[arr[0]] = [9]; +if (arr[0] != 9) throw "arr[0] not set by array destructuring assignment"; +({prop:obj.p} = {prop:12}); +if (obj.p != 12) throw "obj.p not set by object destructuring assignment"; +({prop:arr[0]} = {prop:12}); +if (arr[0] != 12) throw "arr[0] not set by object destructuring assignment"; + +"success"