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

Unified Diff: src/v8natives.js

Issue 585373003: Convert `obj` ToObject in Object.keys() (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Skip es5 test262 tests which assert that Object.keys() throws on primitives Created 6 years, 3 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
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index 782b953ea9763edf0dadbc32511d32a6deef0463..bc6a375d7513050c004de62ba3fd9f91a7fd00ba 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -325,9 +325,7 @@ function ObjectLookupSetter(name) {
function ObjectKeys(obj) {
- if (!IS_SPEC_OBJECT(obj)) {
- throw MakeTypeError("called_on_non_object", ["Object.keys"]);
- }
+ obj = ToObject(obj);
if (%IsJSProxy(obj)) {
var handler = %GetHandler(obj);
var names = CallTrap0(handler, "keys", DerivedKeysTrap);
« no previous file with comments | « AUTHORS ('k') | test/mjsunit/third_party/object-keys.js » ('j') | test/test262/test262.status » ('J')

Powered by Google App Engine
This is Rietveld 408576698