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

Side by Side Diff: src/js/v8natives.js

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 unified diff | Download patch
« no previous file with comments | « no previous file | src/runtime/runtime-object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function(global, utils) { 5 (function(global, utils) {
6 6
7 %CheckIsBootstrapping(); 7 %CheckIsBootstrapping();
8 8
9 // ---------------------------------------------------------------------------- 9 // ----------------------------------------------------------------------------
10 // Imports 10 // Imports
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 return this.toString(); 176 return this.toString();
177 } 177 }
178 178
179 179
180 // ECMA-262 - 15.2.4.4 180 // ECMA-262 - 15.2.4.4
181 function ObjectValueOf() { 181 function ObjectValueOf() {
182 return TO_OBJECT(this); 182 return TO_OBJECT(this);
183 } 183 }
184 184
185 185
186 // ECMA-262 - 15.2.4.5 186 // ES6 7.3.11
187 function ObjectHasOwnProperty(value) { 187 function ObjectHasOwnProperty(value) {
188 var name = TO_NAME(value); 188 var name = TO_NAME(value);
189 var object = TO_OBJECT(this); 189 var object = TO_OBJECT(this);
190
191 if (%_IsJSProxy(object)) {
192 // TODO(rossberg): adjust once there is a story for symbols vs proxies.
193 if (IS_SYMBOL(value)) return false;
194
195 var handler = %GetHandler(object);
196 return CallTrap1(handler, "hasOwn", ProxyDerivedHasOwnTrap, name);
197 }
198 return %HasOwnProperty(object, name); 190 return %HasOwnProperty(object, name);
199 } 191 }
200 192
201 193
202 // ECMA-262 - 15.2.4.6 194 // ECMA-262 - 15.2.4.6
203 function ObjectIsPrototypeOf(V) { 195 function ObjectIsPrototypeOf(V) {
204 if (!IS_SPEC_OBJECT(V)) return false; 196 if (!IS_SPEC_OBJECT(V)) return false;
205 var O = TO_OBJECT(this); 197 var O = TO_OBJECT(this);
206 return %_HasInPrototypeChain(V, O); 198 return %_HasInPrototypeChain(V, O);
207 } 199 }
(...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after
1762 1754
1763 %InstallToContext([ 1755 %InstallToContext([
1764 "global_eval_fun", GlobalEval, 1756 "global_eval_fun", GlobalEval,
1765 "object_value_of", ObjectValueOf, 1757 "object_value_of", ObjectValueOf,
1766 "object_to_string", ObjectToString, 1758 "object_to_string", ObjectToString,
1767 "object_get_own_property_descriptor", ObjectGetOwnPropertyDescriptor, 1759 "object_get_own_property_descriptor", ObjectGetOwnPropertyDescriptor,
1768 "to_complete_property_descriptor", ToCompletePropertyDescriptor, 1760 "to_complete_property_descriptor", ToCompletePropertyDescriptor,
1769 ]); 1761 ]);
1770 1762
1771 }) 1763 })
OLDNEW
« no previous file with comments | « no previous file | src/runtime/runtime-object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698