| Index: src/api.cc
|
| diff --git a/src/api.cc b/src/api.cc
|
| index 93ea6a4c028be4b3a9d540be5ab8c9ad8ce018a2..10afa2c43f3731fdba7140effad9051b564175e5 100644
|
| --- a/src/api.cc
|
| +++ b/src/api.cc
|
| @@ -4537,18 +4537,13 @@ int Function::ScriptId() const {
|
|
|
| Local<v8::Value> Function::GetBoundFunction() const {
|
| auto self = Utils::OpenHandle(this);
|
| - if (!self->IsJSFunction()) {
|
| - return v8::Undefined(reinterpret_cast<v8::Isolate*>(self->GetIsolate()));
|
| + if (self->IsJSBoundFunction()) {
|
| + auto bound_function = i::Handle<i::JSBoundFunction>::cast(self);
|
| + auto bound_target_function = i::handle(
|
| + bound_function->bound_target_function(), bound_function->GetIsolate());
|
| + return Utils::CallableToLocal(bound_target_function);
|
| }
|
| - auto func = i::Handle<i::JSFunction>::cast(self);
|
| - if (!func->shared()->bound()) {
|
| - return v8::Undefined(reinterpret_cast<v8::Isolate*>(func->GetIsolate()));
|
| - }
|
| - i::Handle<i::BindingsArray> bound_args = i::Handle<i::BindingsArray>(
|
| - i::BindingsArray::cast(func->function_bindings()));
|
| - i::Handle<i::Object> original(bound_args->bound_function(),
|
| - func->GetIsolate());
|
| - return Utils::CallableToLocal(i::Handle<i::JSFunction>::cast(original));
|
| + return v8::Undefined(reinterpret_cast<v8::Isolate*>(self->GetIsolate()));
|
| }
|
|
|
|
|
|
|