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

Side by Side Diff: src/property-descriptor.cc

Issue 1767123002: [runtime] Pass in receiver as target to the LookupIterator if known to be JSReceiver (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: property-descriptor Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « src/objects-inl.h ('k') | 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 #include "src/property-descriptor.h" 5 #include "src/property-descriptor.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/factory.h" 8 #include "src/factory.h"
9 #include "src/isolate-inl.h" 9 #include "src/isolate-inl.h"
10 #include "src/lookup.h" 10 #include "src/lookup.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 (desc->has_value() || desc->has_writable())) { 98 (desc->has_value() || desc->has_writable())) {
99 // Bail out to slow path to throw an exception. 99 // Bail out to slow path to throw an exception.
100 return false; 100 return false;
101 } 101 }
102 return true; 102 return true;
103 } 103 }
104 104
105 105
106 void CreateDataProperty(Isolate* isolate, Handle<JSObject> object, 106 void CreateDataProperty(Isolate* isolate, Handle<JSObject> object,
107 Handle<String> name, Handle<Object> value) { 107 Handle<String> name, Handle<Object> value) {
108 LookupIterator it(object, name, LookupIterator::OWN_SKIP_INTERCEPTOR); 108 LookupIterator it(object, name, object, LookupIterator::OWN_SKIP_INTERCEPTOR);
109 Maybe<bool> result = JSObject::CreateDataProperty(&it, value); 109 Maybe<bool> result = JSObject::CreateDataProperty(&it, value);
110 CHECK(result.IsJust() && result.FromJust()); 110 CHECK(result.IsJust() && result.FromJust());
111 } 111 }
112 112
113 } // namespace 113 } // namespace
114 114
115 115
116 // ES6 6.2.4.4 "FromPropertyDescriptor" 116 // ES6 6.2.4.4 "FromPropertyDescriptor"
117 Handle<Object> PropertyDescriptor::ToObject(Isolate* isolate) { 117 Handle<Object> PropertyDescriptor::ToObject(Isolate* isolate) {
118 DCHECK(!(PropertyDescriptor::IsAccessorDescriptor(this) && 118 DCHECK(!(PropertyDescriptor::IsAccessorDescriptor(this) &&
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 // Desc.[[Enumerable]] to like.[[Enumerable]]. 325 // Desc.[[Enumerable]] to like.[[Enumerable]].
326 if (!desc->has_enumerable()) desc->set_enumerable(false); 326 if (!desc->has_enumerable()) desc->set_enumerable(false);
327 // 7. If Desc does not have a [[Configurable]] field, set 327 // 7. If Desc does not have a [[Configurable]] field, set
328 // Desc.[[Configurable]] to like.[[Configurable]]. 328 // Desc.[[Configurable]] to like.[[Configurable]].
329 if (!desc->has_configurable()) desc->set_configurable(false); 329 if (!desc->has_configurable()) desc->set_configurable(false);
330 // 8. Return Desc. 330 // 8. Return Desc.
331 } 331 }
332 332
333 } // namespace internal 333 } // namespace internal
334 } // namespace v8 334 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/runtime/runtime-object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698