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

Unified Diff: src/v8natives.js

Issue 1211663002: Fix evaluation order of Object.prototype.hasOwnProperty (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | test/mjsunit/has-own-property-evaluation-order.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 b002be3461852c65df3962e01354134d75b35f12..f556c397399332cff46f594dd010492fdacf614d 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -174,15 +174,18 @@ function ObjectValueOf() {
// ECMA-262 - 15.2.4.5
-function ObjectHasOwnProperty(V) {
- if (%_IsJSProxy(this)) {
+function ObjectHasOwnProperty(value) {
+ var name = $toName(value);
+ var object = TO_OBJECT_INLINE(this);
+
+ if (%_IsJSProxy(object)) {
// TODO(rossberg): adjust once there is a story for symbols vs proxies.
- if (IS_SYMBOL(V)) return false;
+ if (IS_SYMBOL(value)) return false;
- var handler = %GetHandler(this);
- return CallTrap1(handler, "hasOwn", ProxyDerivedHasOwnTrap, $toName(V));
+ var handler = %GetHandler(object);
+ return CallTrap1(handler, "hasOwn", ProxyDerivedHasOwnTrap, name);
}
- return %HasOwnProperty(TO_OBJECT_INLINE(this), $toName(V));
+ return %HasOwnProperty(object, name);
}
« no previous file with comments | « no previous file | test/mjsunit/has-own-property-evaluation-order.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698