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

Side by Side Diff: src/api.cc

Issue 1829833002: [V8] Add v8::Value::TypeOf to API (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Changed to non static Created 4 years, 9 months 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 | « include/v8.h ('k') | test/cctest/test-api.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 3497 matching lines...) Expand 10 before | Expand all | Expand 10 after
3508 return self->StrictEquals(*other); 3508 return self->StrictEquals(*other);
3509 } 3509 }
3510 3510
3511 3511
3512 bool Value::SameValue(Local<Value> that) const { 3512 bool Value::SameValue(Local<Value> that) const {
3513 auto self = Utils::OpenHandle(this); 3513 auto self = Utils::OpenHandle(this);
3514 auto other = Utils::OpenHandle(*that); 3514 auto other = Utils::OpenHandle(*that);
3515 return self->SameValue(*other); 3515 return self->SameValue(*other);
3516 } 3516 }
3517 3517
3518 MaybeLocal<String> Value::TypeOf(v8::Local<v8::Context> context) {
3519 PREPARE_FOR_EXECUTION(context, "TypeOf", String);
3520 i::Handle<i::String> result =
3521 i::Object::TypeOf(isolate, Utils::OpenHandle(this));
3522 has_pending_exception = result.is_null();
jochen (gone - plz use gerrit) 2016/03/30 16:15:13 sorry for not catching this earlier, but as far as
kozy 2016/05/06 17:03:13 Rewritten without PREPATE_FOR_EXECUTION
3523 RETURN_ON_FAILED_EXECUTION(String);
3524 RETURN_ESCAPED(Utils::ToLocal(result));
3525 }
3518 3526
3519 Maybe<bool> v8::Object::Set(v8::Local<v8::Context> context, 3527 Maybe<bool> v8::Object::Set(v8::Local<v8::Context> context,
3520 v8::Local<Value> key, v8::Local<Value> value) { 3528 v8::Local<Value> key, v8::Local<Value> value) {
3521 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::Set()", bool); 3529 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::Set()", bool);
3522 auto self = Utils::OpenHandle(this); 3530 auto self = Utils::OpenHandle(this);
3523 auto key_obj = Utils::OpenHandle(*key); 3531 auto key_obj = Utils::OpenHandle(*key);
3524 auto value_obj = Utils::OpenHandle(*value); 3532 auto value_obj = Utils::OpenHandle(*value);
3525 has_pending_exception = 3533 has_pending_exception =
3526 i::Runtime::SetObjectProperty(isolate, self, key_obj, value_obj, 3534 i::Runtime::SetObjectProperty(isolate, self, key_obj, value_obj,
3527 i::SLOPPY).is_null(); 3535 i::SLOPPY).is_null();
(...skipping 5228 matching lines...) Expand 10 before | Expand all | Expand 10 after
8756 Address callback_address = 8764 Address callback_address =
8757 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8765 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8758 VMState<EXTERNAL> state(isolate); 8766 VMState<EXTERNAL> state(isolate);
8759 ExternalCallbackScope call_scope(isolate, callback_address); 8767 ExternalCallbackScope call_scope(isolate, callback_address);
8760 callback(info); 8768 callback(info);
8761 } 8769 }
8762 8770
8763 8771
8764 } // namespace internal 8772 } // namespace internal
8765 } // namespace v8 8773 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698