blob: c9cd81a48e56365040f62f5c5e5a4af92350569d [file] [log] [blame]
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
function fn() {
var ok = {};
var x = function() {
ok.foo = 42;
};
var result = new x({ x } = { x: 1 });
shouldBe(x, 1);
shouldBe(ok.foo, 42);
}
function fn2() {
var ok = {};
var x = function() {
ok.foo = 42;
};
var result = new x([ x ] = [ 1 ]);
shouldBe(x, 1);
shouldBe(ok.foo, 42);
}
fn();
fn2();