Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Side by Side Diff: src/api.cc

Issue 1417243002: [es6] Partially implement Reflect.setPrototypeOf. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/api-natives.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3667 matching lines...) Expand 10 before | Expand all | Expand 10 after
3678 3678
3679 3679
3680 Maybe<bool> v8::Object::SetPrototype(Local<Context> context, 3680 Maybe<bool> v8::Object::SetPrototype(Local<Context> context,
3681 Local<Value> value) { 3681 Local<Value> value) {
3682 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::SetPrototype()", bool); 3682 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::SetPrototype()", bool);
3683 auto self = Utils::OpenHandle(this); 3683 auto self = Utils::OpenHandle(this);
3684 auto value_obj = Utils::OpenHandle(*value); 3684 auto value_obj = Utils::OpenHandle(*value);
3685 // We do not allow exceptions thrown while setting the prototype 3685 // We do not allow exceptions thrown while setting the prototype
3686 // to propagate outside. 3686 // to propagate outside.
3687 TryCatch try_catch(reinterpret_cast<v8::Isolate*>(isolate)); 3687 TryCatch try_catch(reinterpret_cast<v8::Isolate*>(isolate));
3688 auto result = i::JSObject::SetPrototype(self, value_obj, false); 3688 auto result =
3689 has_pending_exception = result.is_null(); 3689 i::JSObject::SetPrototype(self, value_obj, false, i::THROW_ON_ERROR);
3690 has_pending_exception = result.IsNothing();
3690 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); 3691 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
3691 return Just(true); 3692 return Just(true);
3692 } 3693 }
3693 3694
3694 3695
3695 bool v8::Object::SetPrototype(Local<Value> value) { 3696 bool v8::Object::SetPrototype(Local<Value> value) {
3696 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); 3697 auto context = ContextFromHeapObject(Utils::OpenHandle(this));
3697 return SetPrototype(context, value).FromMaybe(false); 3698 return SetPrototype(context, value).FromMaybe(false);
3698 } 3699 }
3699 3700
(...skipping 4674 matching lines...) Expand 10 before | Expand all | Expand 10 after
8374 Address callback_address = 8375 Address callback_address =
8375 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8376 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8376 VMState<EXTERNAL> state(isolate); 8377 VMState<EXTERNAL> state(isolate);
8377 ExternalCallbackScope call_scope(isolate, callback_address); 8378 ExternalCallbackScope call_scope(isolate, callback_address);
8378 callback(info); 8379 callback(info);
8379 } 8380 }
8380 8381
8381 8382
8382 } // namespace internal 8383 } // namespace internal
8383 } // namespace v8 8384 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/api-natives.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698