Commit e36eb3e9 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[api] Expose v8::Object::IsApiWrapper

Allow querying whether an object is capable of holding information that
is relevant to the embedder in its embedder fields.

Bug: chromium:999262
Change-Id: Iced1a1cc78142481990d40d91d8e70e6e5518c5b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1773268Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63463}
parent 9d304a35
......@@ -3785,6 +3785,15 @@ class V8_EXPORT Object : public Value {
*/
bool IsConstructor();
/**
* True if this object can carry information relevant to the embedder in its
* embedder fields, false otherwise. This is generally true for objects
* constructed through function templates but also holds for other types where
* V8 automatically adds internal fields at compile time, such as e.g.
* v8::ArrayBuffer.
*/
bool IsApiWrapper();
/**
* Call an Object as a function if a callback is set by the
* ObjectTemplate::SetCallAsFunctionHandler method.
......
......@@ -4713,6 +4713,11 @@ bool v8::Object::IsConstructor() {
return self->IsConstructor();
}
bool v8::Object::IsApiWrapper() {
auto self = i::Handle<i::JSObject>::cast(Utils::OpenHandle(this));
return self->IsApiWrapper();
}
MaybeLocal<Value> Object::CallAsFunction(Local<Context> context,
Local<Value> recv, int argc,
Local<Value> argv[]) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment