blob: 6da1db8acdf997a22730b25b6880af01ec82ebb1 [file] [log] [blame]
// See https://tc39.github.io/ecma262/#sec-object.seal
// See https://tc39.github.io/ecma262/#sec-setintegritylevel
var x = [10];
var visited = [];
var proxy = new Proxy(x, {
preventExtensions() {
visited.push("proxy_preventExtensions");
return false;
}
});
var exception;
try {
visited.push("before_seal");
Object.seal(proxy);
visited.push("after_seal");
} catch (e) {
visited.push("catch");
exception = e;
}
var exceptionStr = "" + exception;
if (!exceptionStr.startsWith("TypeError:"))
throw "Did not throw expected TypeError";
if (visited != "before_seal,proxy_preventExtensions,catch")
throw "ERROR: visited = " + visited;