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 3894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3905 RETURN_TO_LOCAL_UNCHECKED(ObjectProtoToString(context), String); | 3905 RETURN_TO_LOCAL_UNCHECKED(ObjectProtoToString(context), String); |
3906 } | 3906 } |
3907 | 3907 |
3908 | 3908 |
3909 Local<String> v8::Object::GetConstructorName() { | 3909 Local<String> v8::Object::GetConstructorName() { |
3910 auto self = Utils::OpenHandle(this); | 3910 auto self = Utils::OpenHandle(this); |
3911 i::Handle<i::String> name = i::JSReceiver::GetConstructorName(self); | 3911 i::Handle<i::String> name = i::JSReceiver::GetConstructorName(self); |
3912 return Utils::ToLocal(name); | 3912 return Utils::ToLocal(name); |
3913 } | 3913 } |
3914 | 3914 |
| 3915 Maybe<bool> v8::Object::SetIntegrityLevel(Local<Context> context, |
| 3916 IntegrityLevel level) { |
| 3917 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::SetIntegrityLevel()", |
| 3918 bool); |
| 3919 auto self = Utils::OpenHandle(this); |
| 3920 i::JSReceiver::IntegrityLevel i_level = |
| 3921 level == IntegrityLevel::kFrozen ? i::FROZEN : i::SEALED; |
| 3922 Maybe<bool> result = |
| 3923 i::JSReceiver::SetIntegrityLevel(self, i_level, i::Object::DONT_THROW); |
| 3924 has_pending_exception = result.IsNothing(); |
| 3925 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); |
| 3926 return result; |
| 3927 } |
3915 | 3928 |
3916 Maybe<bool> v8::Object::Delete(Local<Context> context, Local<Value> key) { | 3929 Maybe<bool> v8::Object::Delete(Local<Context> context, Local<Value> key) { |
3917 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::Delete()", bool); | 3930 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::Delete()", bool); |
3918 auto self = Utils::OpenHandle(this); | 3931 auto self = Utils::OpenHandle(this); |
3919 auto key_obj = Utils::OpenHandle(*key); | 3932 auto key_obj = Utils::OpenHandle(*key); |
3920 Maybe<bool> result = | 3933 Maybe<bool> result = |
3921 i::Runtime::DeleteObjectProperty(isolate, self, key_obj, i::SLOPPY); | 3934 i::Runtime::DeleteObjectProperty(isolate, self, key_obj, i::SLOPPY); |
3922 has_pending_exception = result.IsNothing(); | 3935 has_pending_exception = result.IsNothing(); |
3923 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); | 3936 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); |
3924 return result; | 3937 return result; |
(...skipping 4863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8788 Address callback_address = | 8801 Address callback_address = |
8789 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8802 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8790 VMState<EXTERNAL> state(isolate); | 8803 VMState<EXTERNAL> state(isolate); |
8791 ExternalCallbackScope call_scope(isolate, callback_address); | 8804 ExternalCallbackScope call_scope(isolate, callback_address); |
8792 callback(info); | 8805 callback(info); |
8793 } | 8806 } |
8794 | 8807 |
8795 | 8808 |
8796 } // namespace internal | 8809 } // namespace internal |
8797 } // namespace v8 | 8810 } // namespace v8 |
OLD | NEW |