| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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.h" | 5 #include "src/api.h" |
| 6 | 6 |
| 7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
| 8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
| 9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
| 10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
| (...skipping 3620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3631 name = i::Handle<i::Name>::cast(key); | 3631 name = i::Handle<i::Name>::cast(key); |
| 3632 } else { | 3632 } else { |
| 3633 // Call-back into JavaScript to convert the key to a string. | 3633 // Call-back into JavaScript to convert the key to a string. |
| 3634 i::Handle<i::Object> converted; | 3634 i::Handle<i::Object> converted; |
| 3635 ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, converted, | 3635 ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, converted, |
| 3636 i::Execution::ToString(isolate, key), | 3636 i::Execution::ToString(isolate, key), |
| 3637 i::MaybeHandle<i::Object>()); | 3637 i::MaybeHandle<i::Object>()); |
| 3638 name = i::Handle<i::String>::cast(converted); | 3638 name = i::Handle<i::String>::cast(converted); |
| 3639 } | 3639 } |
| 3640 | 3640 |
| 3641 return i::JSObject::DefinePropertyOrElement(js_object, name, value, attrs); | 3641 return i::JSObject::DefinePropertyOrElementIgnoreAttributes(js_object, name, |
| 3642 value, attrs); |
| 3642 } | 3643 } |
| 3643 | 3644 |
| 3644 | 3645 |
| 3645 Maybe<bool> v8::Object::ForceSet(v8::Local<v8::Context> context, | 3646 Maybe<bool> v8::Object::ForceSet(v8::Local<v8::Context> context, |
| 3646 v8::Local<Value> key, v8::Local<Value> value, | 3647 v8::Local<Value> key, v8::Local<Value> value, |
| 3647 v8::PropertyAttribute attribs) { | 3648 v8::PropertyAttribute attribs) { |
| 3648 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::Set()", bool); | 3649 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::Set()", bool); |
| 3649 auto self = Utils::OpenHandle(this); | 3650 auto self = Utils::OpenHandle(this); |
| 3650 auto key_obj = Utils::OpenHandle(*key); | 3651 auto key_obj = Utils::OpenHandle(*key); |
| 3651 auto value_obj = Utils::OpenHandle(*value); | 3652 auto value_obj = Utils::OpenHandle(*value); |
| (...skipping 4793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8445 Address callback_address = | 8446 Address callback_address = |
| 8446 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8447 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 8447 VMState<EXTERNAL> state(isolate); | 8448 VMState<EXTERNAL> state(isolate); |
| 8448 ExternalCallbackScope call_scope(isolate, callback_address); | 8449 ExternalCallbackScope call_scope(isolate, callback_address); |
| 8449 callback(info); | 8450 callback(info); |
| 8450 } | 8451 } |
| 8451 | 8452 |
| 8452 | 8453 |
| 8453 } // namespace internal | 8454 } // namespace internal |
| 8454 } // namespace v8 | 8455 } // namespace v8 |
| OLD | NEW |