PageRenderTime 26ms CodeModel.GetById 16ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/js/src/jit-test/tests/debug/Object-preventExtensions-01.js

http://github.com/zpao/v8monkey
JavaScript | 16 lines | 10 code | 4 blank | 2 comment | 0 complexity | 5d553d900d75befc4ec89de16c2d3aaa MD5 | raw file
 1// Basic preventExtensions test.
 2
 3var g = newGlobal('new-compartment');
 4var obj = g.eval("({x: 1})");
 5assertEq(g.Object.isExtensible(obj), true);
 6
 7var dbg = new Debugger;
 8var objw = dbg.addDebuggee(obj);
 9assertEq(objw.isExtensible(), true);
10
11assertEq(objw.preventExtensions(), undefined);
12assertEq(g.Object.isExtensible(obj), false);
13assertEq(objw.isExtensible(), false);
14
15// Calling preventExtensions again has no effect.
16assertEq(objw.preventExtensions(), undefined);