From f7d6147e43b8a80a0d627f2034271239db500d9f Mon Sep 17 00:00:00 2001 From: Jackson Tian Date: Mon, 25 Aug 2014 20:55:11 +0800 Subject: [PATCH] src: Add function name for .byteLength/.compare Reviewed-By: Fedor Indutny --- src/node_buffer.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/node_buffer.cc b/src/node_buffer.cc index c62206ece99..dada1002baf 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -671,12 +671,15 @@ void SetupBufferJS(const FunctionCallbackInfo& args) { Local internal = args[1].As(); - internal->Set(env->byte_length_string(), - FunctionTemplate::New( - env->isolate(), ByteLength)->GetFunction()); - internal->Set(env->compare_string(), - FunctionTemplate::New( - env->isolate(), Compare)->GetFunction()); + Local byte_length = FunctionTemplate::New( + env->isolate(), ByteLength)->GetFunction(); + byte_length->SetName(env->byte_length_string()); + internal->Set(env->byte_length_string(), byte_length); + + Local compare = FunctionTemplate::New( + env->isolate(), Compare)->GetFunction(); + compare->SetName(env->compare_string()); + internal->Set(env->compare_string(), compare); }