Index: test/mjsunit/regress/regress-95920.js |
diff --git a/test/mjsunit/regress/regress-95920.js b/test/mjsunit/regress/regress-95920.js |
index 20e73fbc4026c3969877b6d2e5850d7d2fb2c5c6..55849655614a499d89390b814151302227f85727 100644 |
--- a/test/mjsunit/regress/regress-95920.js |
+++ b/test/mjsunit/regress/regress-95920.js |
@@ -28,31 +28,23 @@ |
// Tests that objects with external arrays cannot be sealed or have their |
// properties redefined. |
-(function() { |
- assertThrows(function() { |
- [0].every(function(){ Object.seal((new Int8Array(42))); }); |
- assertUnreable(); |
- }, TypeError) |
-})(); |
+Object.preventExtensions(new Int8Array(42)); |
+Object.seal(new Int8Array(42)); |
-(function() { |
- assertThrows(function() { |
- [0].every(function(){ Object.freeze((new Int8Array(42))); }); |
- assertUnreable(); |
- }, TypeError) |
-})(); |
+// No elements, so should succeed. |
+Object.freeze(new Int8Array(0)); |
-(function() { |
- assertThrows(function() { |
- [0].every(function(){ Object.preventExtensions((new Int8Array(42))); }); |
- assertUnreable(); |
- }, TypeError) |
-})(); |
+var o = new Int8Array(42); |
+assertThrows(function() { |
+ Object.freeze(o); |
+ assertUnreable(); |
+ }, TypeError); |
-(function() { |
- assertThrows(function() { |
- Object.defineProperty(new Int8Array(42), "1", |
- { writable: false, value: "1" }); |
- assertUnreable(); |
- }) |
-})(); |
+// Freeze should still have managed to preventExtensions o. |
+assertFalse(Object.isExtensible(o)); |
+ |
+assertThrows(function() { |
+ Object.defineProperty(new Int8Array(42), "1", |
+ { writable: false, value: "1" }); |
+ assertUnreable(); |
+ }); |