From 68d18714f7bfe1286e72055c8e4e7a3e87a42a46 Mon Sep 17 00:00:00 2001 From: gengjiawen Date: Tue, 5 Mar 2019 21:53:04 +0800 Subject: [PATCH] src: delete unused method SetTemplateMethod PR-URL: https://github.com/nodejs/node/pull/26451 Reviewed-By: Luigi Pinca Reviewed-By: Ruben Bridgewater --- src/env-inl.h | 15 --------------- src/env.h | 3 --- 2 files changed, 18 deletions(-) diff --git a/src/env-inl.h b/src/env-inl.h index 6386981215a..34263939019 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -942,21 +942,6 @@ inline void Environment::SetProtoMethodNoSideEffect( t->SetClassName(name_string); // NODE_SET_PROTOTYPE_METHOD() compatibility. } -inline void Environment::SetTemplateMethod(v8::Local that, - const char* name, - v8::FunctionCallback callback) { - v8::Local t = - NewFunctionTemplate(callback, v8::Local(), - v8::ConstructorBehavior::kAllow, - v8::SideEffectType::kHasSideEffect); - // kInternalized strings are created in the old space. - const v8::NewStringType type = v8::NewStringType::kInternalized; - v8::Local name_string = - v8::String::NewFromUtf8(isolate(), name, type).ToLocalChecked(); - that->Set(name_string, t); - t->SetClassName(name_string); // NODE_SET_METHOD() compatibility. -} - void Environment::AddCleanupHook(void (*fn)(void*), void* arg) { auto insertion_info = cleanup_hooks_.emplace(CleanupHookCallback { fn, arg, cleanup_hook_counter_++ diff --git a/src/env.h b/src/env.h index 2a8091a92ba..b269982a0ba 100644 --- a/src/env.h +++ b/src/env.h @@ -874,9 +874,6 @@ class Environment { inline void SetProtoMethod(v8::Local that, const char* name, v8::FunctionCallback callback); - inline void SetTemplateMethod(v8::Local that, - const char* name, - v8::FunctionCallback callback); // Safe variants denote the function has no side effects. inline void SetMethodNoSideEffect(v8::Local that,