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

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

Issue 1484313003: [runtime] [proxy] Fix Object.prototype.propertyIsEnumerable to support proxies (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: more tests + proper argument conversion 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 200
201 201
202 // ECMA-262 - 15.2.4.6 202 // ECMA-262 - 15.2.4.6
203 function ObjectIsPrototypeOf(V) { 203 function ObjectIsPrototypeOf(V) {
204 if (!IS_SPEC_OBJECT(V)) return false; 204 if (!IS_SPEC_OBJECT(V)) return false;
205 var O = TO_OBJECT(this); 205 var O = TO_OBJECT(this);
206 return %_HasInPrototypeChain(V, O); 206 return %_HasInPrototypeChain(V, O);
207 } 207 }
208 208
209 209
210 // ECMA-262 - 15.2.4.6 210 // ES6 19.1.3.4
211 function ObjectPropertyIsEnumerable(V) { 211 function ObjectPropertyIsEnumerable(V) {
212 var P = TO_NAME(V); 212 var P = TO_NAME(V);
213 if (%_IsJSProxy(this)) {
214 // TODO(rossberg): adjust once there is a story for symbols vs proxies.
215 if (IS_SYMBOL(V)) return false;
216
217 var desc = GetOwnPropertyJS(this, P);
218 return IS_UNDEFINED(desc) ? false : desc.isEnumerable();
219 }
220 return %IsPropertyEnumerable(TO_OBJECT(this), P); 213 return %IsPropertyEnumerable(TO_OBJECT(this), P);
221 } 214 }
222 215
223 216
224 // Extensions for providing property getters and setters. 217 // Extensions for providing property getters and setters.
225 function ObjectDefineGetter(name, fun) { 218 function ObjectDefineGetter(name, fun) {
226 var receiver = this; 219 var receiver = this;
227 if (IS_NULL(receiver) || IS_UNDEFINED(receiver)) { 220 if (IS_NULL(receiver) || IS_UNDEFINED(receiver)) {
228 receiver = %GlobalProxy(ObjectDefineGetter); 221 receiver = %GlobalProxy(ObjectDefineGetter);
229 } 222 }
(...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after
1762 1755
1763 %InstallToContext([ 1756 %InstallToContext([
1764 "global_eval_fun", GlobalEval, 1757 "global_eval_fun", GlobalEval,
1765 "object_value_of", ObjectValueOf, 1758 "object_value_of", ObjectValueOf,
1766 "object_to_string", ObjectToString, 1759 "object_to_string", ObjectToString,
1767 "object_get_own_property_descriptor", ObjectGetOwnPropertyDescriptor, 1760 "object_get_own_property_descriptor", ObjectGetOwnPropertyDescriptor,
1768 "to_complete_property_descriptor", ToCompletePropertyDescriptor, 1761 "to_complete_property_descriptor", ToCompletePropertyDescriptor,
1769 ]); 1762 ]);
1770 1763
1771 }) 1764 })
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