blob: 85af47e2c9e98b56ca37b320451396b2cd5c0ebe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
function trySetProperty(o, p, v, strict) {
function strictSetProperty() {
"use strict";
o[p] = v;
}
try {
strictSetProperty();
} catch (e) {
return "throw";
}
}
//var objs = [[0], [1]];
var objs = [{a: 0}, {a: 1}];
for (var i = 0, sz = objs.length; i < sz; i++) {
var o = objs[i];
var o2 = Object.preventExtensions(o);
print(i +' ' + o);
assertEq(trySetProperty(o, "baz", 17, true), "throw", "object " + i);
}
|