| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |