Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
src: Add function name for .byteLength/.compare
Browse files Browse the repository at this point in the history
Reviewed-By: Fedor Indutny <fedor@indutny.com>
  • Loading branch information
JacksonTian authored and indutny committed Aug 27, 2014
1 parent 6adf3ec commit f7d6147
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/node_buffer.cc
Expand Up @@ -671,12 +671,15 @@ void SetupBufferJS(const FunctionCallbackInfo<Value>& args) {

Local<Object> internal = args[1].As<Object>();

internal->Set(env->byte_length_string(),
FunctionTemplate::New(
env->isolate(), ByteLength)->GetFunction());
internal->Set(env->compare_string(),
FunctionTemplate::New(
env->isolate(), Compare)->GetFunction());
Local<Function> byte_length = FunctionTemplate::New(
env->isolate(), ByteLength)->GetFunction();
byte_length->SetName(env->byte_length_string());
internal->Set(env->byte_length_string(), byte_length);

Local<Function> compare = FunctionTemplate::New(
env->isolate(), Compare)->GetFunction();
compare->SetName(env->compare_string());
internal->Set(env->compare_string(), compare);
}


Expand Down

0 comments on commit f7d6147

Please sign in to comment.