Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1388)

Unified Diff: test/mjsunit/object-get-own-property-names.js

Issue 12342003: Use InternalArray in Object.getOwnPropertyNames() implementation (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Dealt with review comments Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/v8natives.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/v8natives.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698