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

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

Issue 1476403004: Remove Object::IsSpecObject, use Object::IsJSReceiver instead. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. 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 | « src/objects-inl.h ('k') | src/runtime/runtime-classes.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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 141
142 142
143 // ES6 6.2.4.5 143 // ES6 6.2.4.5
144 // Returns false in case of exception. 144 // Returns false in case of exception.
145 // static 145 // static
146 bool PropertyDescriptor::ToPropertyDescriptor(Isolate* isolate, 146 bool PropertyDescriptor::ToPropertyDescriptor(Isolate* isolate,
147 Handle<Object> obj, 147 Handle<Object> obj,
148 PropertyDescriptor* desc) { 148 PropertyDescriptor* desc) {
149 // 1. ReturnIfAbrupt(Obj). 149 // 1. ReturnIfAbrupt(Obj).
150 // 2. If Type(Obj) is not Object, throw a TypeError exception. 150 // 2. If Type(Obj) is not Object, throw a TypeError exception.
151 if (!obj->IsSpecObject()) { 151 if (!obj->IsJSReceiver()) {
152 isolate->Throw(*isolate->factory()->NewTypeError( 152 isolate->Throw(*isolate->factory()->NewTypeError(
153 MessageTemplate::kPropertyDescObject, obj)); 153 MessageTemplate::kPropertyDescObject, obj));
154 return false; 154 return false;
155 } 155 }
156 // 3. Let desc be a new Property Descriptor that initially has no fields. 156 // 3. Let desc be a new Property Descriptor that initially has no fields.
157 DCHECK(desc->is_empty()); 157 DCHECK(desc->is_empty());
158 158
159 if (ToPropertyDescriptorFastPath(isolate, obj, desc)) { 159 if (ToPropertyDescriptorFastPath(isolate, obj, desc)) {
160 return true; 160 return true;
161 } 161 }
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 // Desc.[[Enumerable]] to like.[[Enumerable]]. 291 // Desc.[[Enumerable]] to like.[[Enumerable]].
292 if (!desc->has_enumerable()) desc->set_enumerable(false); 292 if (!desc->has_enumerable()) desc->set_enumerable(false);
293 // 7. If Desc does not have a [[Configurable]] field, set 293 // 7. If Desc does not have a [[Configurable]] field, set
294 // Desc.[[Configurable]] to like.[[Configurable]]. 294 // Desc.[[Configurable]] to like.[[Configurable]].
295 if (!desc->has_configurable()) desc->set_configurable(false); 295 if (!desc->has_configurable()) desc->set_configurable(false);
296 // 8. Return Desc. 296 // 8. Return Desc.
297 } 297 }
298 298
299 } // namespace internal 299 } // namespace internal
300 } // namespace v8 300 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/runtime/runtime-classes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698