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 4103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4114 Local<Name> key) { | 4114 Local<Name> key) { |
4115 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Object, HasOwnProperty, bool); | 4115 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Object, HasOwnProperty, bool); |
4116 auto self = Utils::OpenHandle(this); | 4116 auto self = Utils::OpenHandle(this); |
4117 auto key_val = Utils::OpenHandle(*key); | 4117 auto key_val = Utils::OpenHandle(*key); |
4118 auto result = i::JSReceiver::HasOwnProperty(self, key_val); | 4118 auto result = i::JSReceiver::HasOwnProperty(self, key_val); |
4119 has_pending_exception = result.IsNothing(); | 4119 has_pending_exception = result.IsNothing(); |
4120 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); | 4120 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); |
4121 return result; | 4121 return result; |
4122 } | 4122 } |
4123 | 4123 |
| 4124 Maybe<bool> v8::Object::HasOwnProperty(Local<Context> context, uint32_t index) { |
| 4125 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Object, HasOwnProperty, bool); |
| 4126 auto self = Utils::OpenHandle(this); |
| 4127 auto result = i::JSReceiver::HasOwnProperty(self, index); |
| 4128 has_pending_exception = result.IsNothing(); |
| 4129 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); |
| 4130 return result; |
| 4131 } |
4124 | 4132 |
4125 bool v8::Object::HasOwnProperty(Local<String> key) { | 4133 bool v8::Object::HasOwnProperty(Local<String> key) { |
4126 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); | 4134 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); |
4127 return HasOwnProperty(context, key).FromMaybe(false); | 4135 return HasOwnProperty(context, key).FromMaybe(false); |
4128 } | 4136 } |
4129 | 4137 |
4130 | 4138 |
4131 Maybe<bool> v8::Object::HasRealNamedProperty(Local<Context> context, | 4139 Maybe<bool> v8::Object::HasRealNamedProperty(Local<Context> context, |
4132 Local<Name> key) { | 4140 Local<Name> key) { |
4133 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Object, HasRealNamedProperty, bool); | 4141 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Object, HasRealNamedProperty, bool); |
(...skipping 4664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8798 Address callback_address = | 8806 Address callback_address = |
8799 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8807 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8800 VMState<EXTERNAL> state(isolate); | 8808 VMState<EXTERNAL> state(isolate); |
8801 ExternalCallbackScope call_scope(isolate, callback_address); | 8809 ExternalCallbackScope call_scope(isolate, callback_address); |
8802 callback(info); | 8810 callback(info); |
8803 } | 8811 } |
8804 | 8812 |
8805 | 8813 |
8806 } // namespace internal | 8814 } // namespace internal |
8807 } // namespace v8 | 8815 } // namespace v8 |
OLD | NEW |