Index: test/mjsunit/object-get-own-property-names.js |
diff --git a/test/mjsunit/object-get-own-property-names.js b/test/mjsunit/object-get-own-property-names.js |
index 33aa85ef15d6122fc3038100a6e51dab6a9f7b1b..64607c6b94a2713394207e569457bc6efa4b7b9d 100644 |
--- a/test/mjsunit/object-get-own-property-names.js |
+++ b/test/mjsunit/object-get-own-property-names.js |
@@ -77,6 +77,16 @@ propertyNames.sort(); |
assertEquals(1, propertyNames.length); |
assertEquals("getter", propertyNames[0]); |
+// Check that implementation does not access Array.prototype. |
+var savedConcat = Array.prototype.concat; |
+Array.prototype.concat = function() { return []; } |
+propertyNames = Object.getOwnPropertyNames({0: 'foo', bar: 'baz'}); |
+assertEquals(2, propertyNames.length); |
+assertEquals('0', propertyNames[0]); |
+assertEquals('bar', propertyNames[1]); |
+assertSame(Array.prototype, propertyNames.__proto__); |
+Array.prototype.concat = savedConcat; |
+ |
try { |
Object.getOwnPropertyNames(4); |
assertTrue(false); |