diff options
Diffstat (limited to 'deps/v8/test/mjsunit/regress/regress-115452.js')
-rw-r--r-- | deps/v8/test/mjsunit/regress/regress-115452.js | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/deps/v8/test/mjsunit/regress/regress-115452.js b/deps/v8/test/mjsunit/regress/regress-115452.js index 7e424ed88b..dc711581e9 100644 --- a/deps/v8/test/mjsunit/regress/regress-115452.js +++ b/deps/v8/test/mjsunit/regress/regress-115452.js @@ -27,22 +27,21 @@ // Test that a function declaration cannot overwrite a read-only property. -print(0) +// Flags: --es52_globals + function foobl() {} assertTrue(typeof this.foobl == "function"); assertTrue(Object.getOwnPropertyDescriptor(this, "foobl").writable); -print(1) Object.defineProperty(this, "foobl", {value: 1, writable: false}); assertSame(1, this.foobl); assertFalse(Object.getOwnPropertyDescriptor(this, "foobl").writable); -print(2) -eval("function foobl() {}"); +// This has to run in global scope, so cannot use assertThrows... +try { + eval("function foobl() {}"); // Should throw. + assertUnreachable(); +} catch (e) { + assertInstanceof(e, TypeError); +} assertSame(1, this.foobl); -assertFalse(Object.getOwnPropertyDescriptor(this, "foobl").writable); - -print(3) -eval("function foobl() {}"); -assertSame(1, this.foobl); -assertFalse(Object.getOwnPropertyDescriptor(this, "foobl").writable); |