Debian Codegraph @

rhino/testsrc/jstests/destructuringLvalue.jstest

raw
1 // This Source Code Form is subject to the terms of the Mozilla Public
2 // License, v. 2.0. If a copy of the MPL was not distributed with this
3 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
5 /* TODO(stevey): fix this test
6 var obj = { p:3 };
7 var arr = [ 3 ];
8 [obj.p] = [9];
9 if (obj.p != 9) throw "obj.p not set by array destructuring assignment";
10 [arr[0]] = [9];
11 if (arr[0] != 9) throw "arr[0] not set by array destructuring assignment";
12 ({prop:obj.p} = {prop:12});
13 if (obj.p != 12) throw "obj.p not set by object destructuring assignment";
14 ({prop:arr[0]} = {prop:12});
15 if (arr[0] != 12) throw "arr[0] not set by object destructuring assignment";
16 */
17 "success"