diff options
Diffstat (limited to 'deps/v8/src/api-arguments-inl.h')
-rw-r--r-- | deps/v8/src/api-arguments-inl.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/deps/v8/src/api-arguments-inl.h b/deps/v8/src/api-arguments-inl.h index 4d91b68521b..89f606ed410 100644 --- a/deps/v8/src/api-arguments-inl.h +++ b/deps/v8/src/api-arguments-inl.h @@ -7,6 +7,7 @@ #include "src/api-arguments.h" +#include "src/api-inl.h" #include "src/objects/api-callbacks.h" #include "src/tracing/trace-event.h" #include "src/vm-state-inl.h" @@ -14,6 +15,29 @@ namespace v8 { namespace internal { +CustomArgumentsBase::CustomArgumentsBase(Isolate* isolate) + : Relocatable(isolate) {} + +template <typename T> +template <typename V> +Handle<V> CustomArguments<T>::GetReturnValue(Isolate* isolate) { + // Check the ReturnValue. + Object** handle = &this->begin()[kReturnValueOffset]; + // Nothing was set, return empty handle as per previous behaviour. + if ((*handle)->IsTheHole(isolate)) return Handle<V>(); + Handle<V> result = Handle<V>::cast(Handle<Object>(handle)); + result->VerifyApiCallResultType(); + return result; +} + +inline JSObject* PropertyCallbackArguments::holder() { + return JSObject::cast(this->begin()[T::kHolderIndex]); +} + +inline JSObject* FunctionCallbackArguments::holder() { + return JSObject::cast(this->begin()[T::kHolderIndex]); +} + #define FOR_EACH_CALLBACK(F) \ F(Query, query, Object, v8::Integer, interceptor) \ F(Deleter, deleter, Object, v8::Boolean, Handle<Object>()) |