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 3640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3651 name = i::Handle<i::Name>::cast(key); | 3651 name = i::Handle<i::Name>::cast(key); |
3652 } else { | 3652 } else { |
3653 // Call-back into JavaScript to convert the key to a string. | 3653 // Call-back into JavaScript to convert the key to a string. |
3654 i::Handle<i::Object> converted; | 3654 i::Handle<i::Object> converted; |
3655 if (!i::Execution::ToString(isolate, key).ToHandle(&converted)) { | 3655 if (!i::Execution::ToString(isolate, key).ToHandle(&converted)) { |
3656 return i::MaybeHandle<i::Object>(); | 3656 return i::MaybeHandle<i::Object>(); |
3657 } | 3657 } |
3658 name = i::Handle<i::String>::cast(converted); | 3658 name = i::Handle<i::String>::cast(converted); |
3659 } | 3659 } |
3660 | 3660 |
3661 if (name->IsString()) { | |
3662 name = i::String::Flatten(i::Handle<i::String>::cast(name)); | |
3663 } | |
3664 return i::JSReceiver::DeleteProperty(receiver, name, language_mode); | 3661 return i::JSReceiver::DeleteProperty(receiver, name, language_mode); |
3665 } | 3662 } |
3666 | 3663 |
3667 } // namespace | 3664 } // namespace |
3668 | 3665 |
3669 | 3666 |
3670 MaybeLocal<Value> v8::Object::Get(Local<v8::Context> context, | 3667 MaybeLocal<Value> v8::Object::Get(Local<v8::Context> context, |
3671 Local<Value> key) { | 3668 Local<Value> key) { |
3672 PREPARE_FOR_EXECUTION(context, "v8::Object::Get()", Value); | 3669 PREPARE_FOR_EXECUTION(context, "v8::Object::Get()", Value); |
3673 auto self = Utils::OpenHandle(this); | 3670 auto self = Utils::OpenHandle(this); |
(...skipping 4725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8399 Address callback_address = | 8396 Address callback_address = |
8400 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8397 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8401 VMState<EXTERNAL> state(isolate); | 8398 VMState<EXTERNAL> state(isolate); |
8402 ExternalCallbackScope call_scope(isolate, callback_address); | 8399 ExternalCallbackScope call_scope(isolate, callback_address); |
8403 callback(info); | 8400 callback(info); |
8404 } | 8401 } |
8405 | 8402 |
8406 | 8403 |
8407 } // namespace internal | 8404 } // namespace internal |
8408 } // namespace v8 | 8405 } // namespace v8 |
OLD | NEW |