Add test
git-svn-id: svn://10.0.0.236/trunk@247675 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
12
mozilla/js/rhino/testsrc/jstests/destructuringLvalue.jstest
Normal file
12
mozilla/js/rhino/testsrc/jstests/destructuringLvalue.jstest
Normal file
@@ -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"
|
||||
Reference in New Issue
Block a user