| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/api-natives.h" | 5 #include "src/api-natives.h" |
| 6 #include "src/isolate-inl.h" | 6 #include "src/isolate-inl.h" |
| 7 | 7 |
| 8 namespace v8 { | 8 namespace v8 { |
| 9 namespace internal { | 9 namespace internal { |
| 10 | 10 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 Handle<Object> value; | 74 Handle<Object> value; |
| 75 ASSIGN_RETURN_ON_EXCEPTION(isolate, value, | 75 ASSIGN_RETURN_ON_EXCEPTION(isolate, value, |
| 76 Instantiate(isolate, prop_data, key), Object); | 76 Instantiate(isolate, prop_data, key), Object); |
| 77 | 77 |
| 78 #ifdef DEBUG | 78 #ifdef DEBUG |
| 79 bool duplicate; | 79 bool duplicate; |
| 80 if (key->IsName()) { | 80 if (key->IsName()) { |
| 81 LookupIterator it(object, Handle<Name>::cast(key), | 81 LookupIterator it(object, Handle<Name>::cast(key), |
| 82 LookupIterator::OWN_SKIP_INTERCEPTOR); | 82 LookupIterator::OWN_SKIP_INTERCEPTOR); |
| 83 Maybe<PropertyAttributes> maybe = JSReceiver::GetPropertyAttributes(&it); | 83 Maybe<PropertyAttributes> maybe = JSReceiver::GetPropertyAttributes(&it); |
| 84 DCHECK(maybe.has_value); | 84 DCHECK(maybe.IsJust()); |
| 85 duplicate = it.IsFound(); | 85 duplicate = it.IsFound(); |
| 86 } else { | 86 } else { |
| 87 uint32_t index = 0; | 87 uint32_t index = 0; |
| 88 key->ToArrayIndex(&index); | 88 key->ToArrayIndex(&index); |
| 89 Maybe<bool> maybe = JSReceiver::HasOwnElement(object, index); | 89 Maybe<bool> maybe = JSReceiver::HasOwnElement(object, index); |
| 90 if (!maybe.has_value) return MaybeHandle<Object>(); | 90 if (!maybe.IsJust()) return MaybeHandle<Object>(); |
| 91 duplicate = maybe.value; | 91 duplicate = maybe.FromJust(); |
| 92 } | 92 } |
| 93 if (duplicate) { | 93 if (duplicate) { |
| 94 Handle<Object> args[1] = {key}; | 94 Handle<Object> args[1] = {key}; |
| 95 THROW_NEW_ERROR(isolate, NewTypeError("duplicate_template_property", | 95 THROW_NEW_ERROR(isolate, NewTypeError("duplicate_template_property", |
| 96 HandleVector(args, 1)), | 96 HandleVector(args, 1)), |
| 97 Object); | 97 Object); |
| 98 } | 98 } |
| 99 #endif | 99 #endif |
| 100 | 100 |
| 101 RETURN_ON_EXCEPTION( | 101 RETURN_ON_EXCEPTION( |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i))); | 579 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i))); |
| 580 JSObject::SetAccessor(result, accessor).Assert(); | 580 JSObject::SetAccessor(result, accessor).Assert(); |
| 581 } | 581 } |
| 582 | 582 |
| 583 DCHECK(result->shared()->IsApiFunction()); | 583 DCHECK(result->shared()->IsApiFunction()); |
| 584 return result; | 584 return result; |
| 585 } | 585 } |
| 586 | 586 |
| 587 } // namespace internal | 587 } // namespace internal |
| 588 } // namespace v8 | 588 } // namespace v8 |
| OLD | NEW |