OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/allocation-site-scopes.h" | 8 #include "src/allocation-site-scopes.h" |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
(...skipping 4075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4086 | 4086 |
4087 | 4087 |
4088 void JSObject::AddProperty(Handle<JSObject> object, Handle<Name> name, | 4088 void JSObject::AddProperty(Handle<JSObject> object, Handle<Name> name, |
4089 Handle<Object> value, | 4089 Handle<Object> value, |
4090 PropertyAttributes attributes) { | 4090 PropertyAttributes attributes) { |
4091 #ifdef DEBUG | 4091 #ifdef DEBUG |
4092 uint32_t index; | 4092 uint32_t index; |
4093 ASSERT(!object->IsJSProxy()); | 4093 ASSERT(!object->IsJSProxy()); |
4094 ASSERT(!name->AsArrayIndex(&index)); | 4094 ASSERT(!name->AsArrayIndex(&index)); |
4095 LookupIterator it(object, name, LookupIterator::CHECK_OWN_REAL); | 4095 LookupIterator it(object, name, LookupIterator::CHECK_OWN_REAL); |
4096 GetPropertyAttributes(&it); | 4096 Maybe<PropertyAttributes> maybe = GetPropertyAttributes(&it); |
| 4097 ASSERT(maybe.has_value); |
4097 ASSERT(!it.IsFound()); | 4098 ASSERT(!it.IsFound()); |
4098 ASSERT(object->map()->is_extensible()); | 4099 ASSERT(object->map()->is_extensible()); |
4099 #endif | 4100 #endif |
4100 SetOwnPropertyIgnoreAttributes(object, name, value, attributes, | 4101 SetOwnPropertyIgnoreAttributes(object, name, value, attributes, |
4101 OMIT_EXTENSIBILITY_CHECK).Check(); | 4102 OMIT_EXTENSIBILITY_CHECK).Check(); |
4102 } | 4103 } |
4103 | 4104 |
4104 | 4105 |
4105 // Reconfigures a property to a data property with attributes, even if it is not | 4106 // Reconfigures a property to a data property with attributes, even if it is not |
4106 // reconfigurable. | 4107 // reconfigurable. |
(...skipping 12856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16963 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16964 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16964 static const char* error_messages_[] = { | 16965 static const char* error_messages_[] = { |
16965 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16966 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16966 }; | 16967 }; |
16967 #undef ERROR_MESSAGES_TEXTS | 16968 #undef ERROR_MESSAGES_TEXTS |
16968 return error_messages_[reason]; | 16969 return error_messages_[reason]; |
16969 } | 16970 } |
16970 | 16971 |
16971 | 16972 |
16972 } } // namespace v8::internal | 16973 } } // namespace v8::internal |
OLD | NEW |