OLD | NEW |
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 (desc->has_value() || desc->has_writable())) { | 96 (desc->has_value() || desc->has_writable())) { |
97 // Bail out to slow path to throw an exception. | 97 // Bail out to slow path to throw an exception. |
98 return false; | 98 return false; |
99 } | 99 } |
100 return true; | 100 return true; |
101 } | 101 } |
102 | 102 |
103 | 103 |
104 static void CreateDataProperty(Isolate* isolate, Handle<JSObject> object, | 104 static void CreateDataProperty(Isolate* isolate, Handle<JSObject> object, |
105 Handle<String> name, Handle<Object> value) { | 105 Handle<String> name, Handle<Object> value) { |
106 LookupIterator it(object, name); | 106 LookupIterator it(object, name, LookupIterator::OWN_SKIP_INTERCEPTOR); |
107 Maybe<bool> result = JSObject::CreateDataProperty(&it, value); | 107 Maybe<bool> result = JSObject::CreateDataProperty(&it, value); |
108 CHECK(result.IsJust() && result.FromJust()); | 108 CHECK(result.IsJust() && result.FromJust()); |
109 } | 109 } |
110 | 110 |
111 | 111 |
112 // ES6 6.2.4.4 "FromPropertyDescriptor" | 112 // ES6 6.2.4.4 "FromPropertyDescriptor" |
113 Handle<Object> PropertyDescriptor::ToObject(Isolate* isolate) { | 113 Handle<Object> PropertyDescriptor::ToObject(Isolate* isolate) { |
114 DCHECK(!(PropertyDescriptor::IsAccessorDescriptor(this) && | 114 DCHECK(!(PropertyDescriptor::IsAccessorDescriptor(this) && |
115 PropertyDescriptor::IsDataDescriptor(this))); | 115 PropertyDescriptor::IsDataDescriptor(this))); |
116 Factory* factory = isolate->factory(); | 116 Factory* factory = isolate->factory(); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |