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 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/isolate-inl.h" | 8 #include "src/isolate-inl.h" |
9 #include "src/lookup.h" | 9 #include "src/lookup.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 Maybe<PropertyAttributes> maybe = JSReceiver::GetPropertyAttributes(&it); | 95 Maybe<PropertyAttributes> maybe = JSReceiver::GetPropertyAttributes(&it); |
96 DCHECK(maybe.IsJust()); | 96 DCHECK(maybe.IsJust()); |
97 if (it.IsFound()) { | 97 if (it.IsFound()) { |
98 THROW_NEW_ERROR( | 98 THROW_NEW_ERROR( |
99 isolate, | 99 isolate, |
100 NewTypeError(MessageTemplate::kDuplicateTemplateProperty, name), | 100 NewTypeError(MessageTemplate::kDuplicateTemplateProperty, name), |
101 Object); | 101 Object); |
102 } | 102 } |
103 #endif | 103 #endif |
104 | 104 |
105 return Object::AddDataProperty(&it, value, attributes, STRICT, | 105 MAYBE_RETURN_NULL( |
106 Object::CERTAINLY_NOT_STORE_FROM_KEYED); | 106 Object::AddDataProperty(&it, value, attributes, Object::THROW_ON_ERROR, |
| 107 Object::CERTAINLY_NOT_STORE_FROM_KEYED)); |
| 108 return value; |
107 } | 109 } |
108 | 110 |
109 | 111 |
110 void DisableAccessChecks(Isolate* isolate, Handle<JSObject> object) { | 112 void DisableAccessChecks(Isolate* isolate, Handle<JSObject> object) { |
111 Handle<Map> old_map(object->map()); | 113 Handle<Map> old_map(object->map()); |
112 // Copy map so it won't interfere constructor's initial map. | 114 // Copy map so it won't interfere constructor's initial map. |
113 Handle<Map> new_map = Map::Copy(old_map, "DisableAccessChecks"); | 115 Handle<Map> new_map = Map::Copy(old_map, "DisableAccessChecks"); |
114 new_map->set_is_access_check_needed(false); | 116 new_map->set_is_access_check_needed(false); |
115 JSObject::MigrateToMap(Handle<JSObject>::cast(object), new_map); | 117 JSObject::MigrateToMap(Handle<JSObject>::cast(object), new_map); |
116 } | 118 } |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i))); | 632 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i))); |
631 JSObject::SetAccessor(result, accessor).Assert(); | 633 JSObject::SetAccessor(result, accessor).Assert(); |
632 } | 634 } |
633 | 635 |
634 DCHECK(result->shared()->IsApiFunction()); | 636 DCHECK(result->shared()->IsApiFunction()); |
635 return result; | 637 return result; |
636 } | 638 } |
637 | 639 |
638 } // namespace internal | 640 } // namespace internal |
639 } // namespace v8 | 641 } // namespace v8 |
OLD | NEW |