Index: src/runtime/runtime-test.cc |
diff --git a/src/runtime/runtime-test.cc b/src/runtime/runtime-test.cc |
index b7201f4c1a337247fa415fa21b3790210a96dfb8..783092c050baaf5a16c8f0922725c6d1f2055c03 100644 |
--- a/src/runtime/runtime-test.cc |
+++ b/src/runtime/runtime-test.cc |
@@ -299,6 +299,9 @@ RUNTIME_FUNCTION(Runtime_GetOptimizationCount) { |
return Smi::FromInt(function->shared()->opt_count()); |
} |
+static void ReturnThis(const v8::FunctionCallbackInfo<v8::Value>& args) { |
+ args.GetReturnValue().Set(args.This()); |
+} |
RUNTIME_FUNCTION(Runtime_GetUndetectable) { |
HandleScope scope(isolate); |
@@ -307,6 +310,7 @@ RUNTIME_FUNCTION(Runtime_GetUndetectable) { |
Local<v8::ObjectTemplate> desc = v8::ObjectTemplate::New(v8_isolate); |
desc->MarkAsUndetectable(); |
+ desc->SetCallAsFunctionHandler(ReturnThis); |
Local<v8::Object> obj; |
if (!desc->NewInstance(v8_isolate->GetCurrentContext()).ToLocal(&obj)) { |
return nullptr; |