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

Unified Diff: src/runtime/runtime-object.cc

Issue 1480213004: [runtime] [proxy] Make Object.prototype.hasOwnProperty support proxies (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: removing unused flag Created 5 years 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/js/v8natives.js ('k') | test/mjsunit/harmony/proxies-has-own-property.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-object.cc
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc
index 26a55ac75b36489e84028946e265318abce52fbb..e8938862a38b14ac477f58339cfc69782497077c 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -714,6 +714,11 @@ RUNTIME_FUNCTION(Runtime_HasOwnProperty) {
if (index < static_cast<uint32_t>(string->length())) {
return isolate->heap()->true_value();
}
+ } else if (object->IsJSProxy()) {
+ Maybe<bool> result =
+ JSReceiver::HasOwnProperty(Handle<JSProxy>::cast(object), key);
+ if (!result.IsJust()) return isolate->heap()->exception();
+ return isolate->heap()->ToBoolean(result.FromJust());
}
return isolate->heap()->false_value();
}
« no previous file with comments | « src/js/v8natives.js ('k') | test/mjsunit/harmony/proxies-has-own-property.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698