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

Unified Diff: src/v8natives.js

Issue 608193002: Revert "Convert `obj` ToObject in Object.keys()" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
« no previous file with comments | « AUTHORS ('k') | test/mjsunit/third_party/object-keys.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index bc6a375d7513050c004de62ba3fd9f91a7fd00ba..782b953ea9763edf0dadbc32511d32a6deef0463 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -325,7 +325,9 @@ function ObjectLookupSetter(name) {
function ObjectKeys(obj) {
- obj = ToObject(obj);
+ if (!IS_SPEC_OBJECT(obj)) {
+ throw MakeTypeError("called_on_non_object", ["Object.keys"]);
+ }
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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698