Index: test/mjsunit/object-freeze.js |
diff --git a/test/mjsunit/object-freeze.js b/test/mjsunit/object-freeze.js |
index 619ada006ea710e1a26ba25b67b3e6ecdfed1530..c3a9278bbd9c4629489f143e52cedba78684ddb4 100644 |
--- a/test/mjsunit/object-freeze.js |
+++ b/test/mjsunit/object-freeze.js |
@@ -28,7 +28,6 @@ |
// Tests the Object.freeze and Object.isFrozen methods - ES 15.2.3.9 and |
// ES 15.2.3.12 |
-// Flags: --allow-natives-syntax |
// Test that we throw an error if an object is not passed as argument. |
var non_objects = new Array(undefined, null, 1, -1, 0, 42.43); |
@@ -192,70 +191,3 @@ assertFalse(Object.isFrozen(obj5)); |
// Make sure that Object.freeze returns the frozen object. |
var obj6 = {} |
assertTrue(obj6 === Object.freeze(obj6)) |
- |
-// Test that the enumerable attribute is unperturbed by freezing. |
-obj = { x: 42, y: 'foo' }; |
-Object.defineProperty(obj, 'y', {enumerable: false}); |
-Object.freeze(obj); |
-desc = Object.getOwnPropertyDescriptor(obj, 'x'); |
-assertTrue(desc.enumerable); |
-desc = Object.getOwnPropertyDescriptor(obj, 'y'); |
-assertFalse(desc.enumerable); |
- |
-// Fast properties should remain fast |
-obj = { x: 42, y: 'foo' }; |
-assertTrue(%HasFastProperties(obj)); |
-Object.freeze(obj); |
-assertTrue(%HasFastProperties(obj)); |
- |
-// Frozen objects should share maps where possible |
-obj = { prop1: 1, prop2: 2 }; |
-obj2 = { prop1: 3, prop2: 4 }; |
-assertTrue(%HaveSameMap(obj, obj2)); |
-Object.freeze(obj); |
-Object.freeze(obj2); |
-assertTrue(%HaveSameMap(obj, obj2)); |
- |
-// Frozen objects should share maps even when they have elements |
-obj = { prop1: 1, prop2: 2, 75: 'foo' }; |
-obj2 = { prop1: 3, prop2: 4, 150: 'bar' }; |
-assertTrue(%HaveSameMap(obj, obj2)); |
-Object.freeze(obj); |
-Object.freeze(obj2); |
-assertTrue(%HaveSameMap(obj, obj2)); |
- |
-// Setting elements after freezing should not be allowed |
-obj = { prop: 'thing' }; |
-Object.freeze(obj); |
-obj[0] = 'hello'; |
-assertFalse(obj.hasOwnProperty(0)); |
- |
-// Freezing an object in dictionary mode should work |
-obj = { }; |
-for (var i = 0; i < 100; ++i) { |
- obj['x' + i] = i; |
-} |
-assertFalse(%HasFastProperties(obj)); |
-Object.freeze(obj); |
-assertFalse(%HasFastProperties(obj)); |
-assertTrue(Object.isFrozen(obj)); |
-assertFalse(Object.isExtensible(obj)); |
-for (var i = 0; i < 100; ++i) { |
- desc = Object.getOwnPropertyDescriptor(obj, 'x' + i); |
- assertFalse(desc.writable); |
- assertFalse(desc.configurable); |
-} |
- |
-// Freezing arguments should work |
-var func = function(arg) { |
- Object.freeze(arguments); |
- assertTrue(Object.isFrozen(arguments)); |
-}; |
-func('hello', 'world'); |
-func('goodbye', 'world'); |
- |
-// Freezing sparse arrays |
-var sparseArr = [0, 1]; |
-sparseArr[10000] = 10000; |
-Object.freeze(sparseArr); |
-assertTrue(Object.isFrozen(sparseArr)); |