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 3490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3501 v8::Local<Name> key, | 3501 v8::Local<Name> key, |
3502 v8::Local<Value> value) { | 3502 v8::Local<Value> value) { |
3503 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::CreateDataProperty()", | 3503 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::CreateDataProperty()", |
3504 bool); | 3504 bool); |
3505 i::Handle<i::JSReceiver> self = Utils::OpenHandle(this); | 3505 i::Handle<i::JSReceiver> self = Utils::OpenHandle(this); |
3506 i::Handle<i::Name> key_obj = Utils::OpenHandle(*key); | 3506 i::Handle<i::Name> key_obj = Utils::OpenHandle(*key); |
3507 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); | 3507 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); |
3508 | 3508 |
3509 i::LookupIterator it = i::LookupIterator::PropertyOrElement( | 3509 i::LookupIterator it = i::LookupIterator::PropertyOrElement( |
3510 isolate, self, key_obj, i::LookupIterator::OWN); | 3510 isolate, self, key_obj, i::LookupIterator::OWN); |
3511 Maybe<bool> result = i::JSReceiver::CreateDataProperty(&it, value_obj); | 3511 Maybe<bool> result = |
| 3512 i::JSReceiver::CreateDataProperty(&it, value_obj, i::Object::DONT_THROW); |
3512 has_pending_exception = result.IsNothing(); | 3513 has_pending_exception = result.IsNothing(); |
3513 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); | 3514 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); |
3514 return result; | 3515 return result; |
3515 } | 3516 } |
3516 | 3517 |
3517 | 3518 |
3518 Maybe<bool> v8::Object::CreateDataProperty(v8::Local<v8::Context> context, | 3519 Maybe<bool> v8::Object::CreateDataProperty(v8::Local<v8::Context> context, |
3519 uint32_t index, | 3520 uint32_t index, |
3520 v8::Local<Value> value) { | 3521 v8::Local<Value> value) { |
3521 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::CreateDataProperty()", | 3522 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::CreateDataProperty()", |
3522 bool); | 3523 bool); |
3523 i::Handle<i::JSReceiver> self = Utils::OpenHandle(this); | 3524 i::Handle<i::JSReceiver> self = Utils::OpenHandle(this); |
3524 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); | 3525 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); |
3525 | 3526 |
3526 i::LookupIterator it(isolate, self, index, i::LookupIterator::OWN); | 3527 i::LookupIterator it(isolate, self, index, i::LookupIterator::OWN); |
3527 Maybe<bool> result = i::JSReceiver::CreateDataProperty(&it, value_obj); | 3528 Maybe<bool> result = |
| 3529 i::JSReceiver::CreateDataProperty(&it, value_obj, i::Object::DONT_THROW); |
3528 has_pending_exception = result.IsNothing(); | 3530 has_pending_exception = result.IsNothing(); |
3529 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); | 3531 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); |
3530 return result; | 3532 return result; |
3531 } | 3533 } |
3532 | 3534 |
3533 | 3535 |
3534 Maybe<bool> v8::Object::DefineOwnProperty(v8::Local<v8::Context> context, | 3536 Maybe<bool> v8::Object::DefineOwnProperty(v8::Local<v8::Context> context, |
3535 v8::Local<Name> key, | 3537 v8::Local<Name> key, |
3536 v8::Local<Value> value, | 3538 v8::Local<Value> value, |
3537 v8::PropertyAttribute attributes) { | 3539 v8::PropertyAttribute attributes) { |
(...skipping 4987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8525 Address callback_address = | 8527 Address callback_address = |
8526 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8528 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8527 VMState<EXTERNAL> state(isolate); | 8529 VMState<EXTERNAL> state(isolate); |
8528 ExternalCallbackScope call_scope(isolate, callback_address); | 8530 ExternalCallbackScope call_scope(isolate, callback_address); |
8529 callback(info); | 8531 callback(info); |
8530 } | 8532 } |
8531 | 8533 |
8532 | 8534 |
8533 } // namespace internal | 8535 } // namespace internal |
8534 } // namespace v8 | 8536 } // namespace v8 |
OLD | NEW |