diff --git a/src/node_buffer.cc b/src/node_buffer.cc index e8d70d329a992a..e8d494519437bf 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -516,36 +516,6 @@ void StringSlice(const FunctionCallbackInfo& args) { } -void Latin1Slice(const FunctionCallbackInfo& args) { - StringSlice(args); -} - - -void AsciiSlice(const FunctionCallbackInfo& args) { - StringSlice(args); -} - - -void Utf8Slice(const FunctionCallbackInfo& args) { - StringSlice(args); -} - - -void Ucs2Slice(const FunctionCallbackInfo& args) { - StringSlice(args); -} - - -void HexSlice(const FunctionCallbackInfo& args) { - StringSlice(args); -} - - -void Base64Slice(const FunctionCallbackInfo& args) { - StringSlice(args); -} - - // bytesCopied = copy(buffer, target[, targetStart][, sourceStart][, sourceEnd]) void Copy(const FunctionCallbackInfo &args) { Environment* env = Environment::GetCurrent(args); @@ -712,36 +682,6 @@ void StringWrite(const FunctionCallbackInfo& args) { } -void Base64Write(const FunctionCallbackInfo& args) { - StringWrite(args); -} - - -void Latin1Write(const FunctionCallbackInfo& args) { - StringWrite(args); -} - - -void Utf8Write(const FunctionCallbackInfo& args) { - StringWrite(args); -} - - -void Ucs2Write(const FunctionCallbackInfo& args) { - StringWrite(args); -} - - -void HexWrite(const FunctionCallbackInfo& args) { - StringWrite(args); -} - - -void AsciiWrite(const FunctionCallbackInfo& args) { - StringWrite(args); -} - - static inline void Swizzle(char* start, unsigned int len) { char* end = start + len - 1; while (start < end) { @@ -1222,19 +1162,19 @@ void SetupBufferJS(const FunctionCallbackInfo& args) { Local proto = args[0].As(); env->set_buffer_prototype_object(proto); - env->SetMethod(proto, "asciiSlice", AsciiSlice); - env->SetMethod(proto, "base64Slice", Base64Slice); - env->SetMethod(proto, "latin1Slice", Latin1Slice); - env->SetMethod(proto, "hexSlice", HexSlice); - env->SetMethod(proto, "ucs2Slice", Ucs2Slice); - env->SetMethod(proto, "utf8Slice", Utf8Slice); - - env->SetMethod(proto, "asciiWrite", AsciiWrite); - env->SetMethod(proto, "base64Write", Base64Write); - env->SetMethod(proto, "latin1Write", Latin1Write); - env->SetMethod(proto, "hexWrite", HexWrite); - env->SetMethod(proto, "ucs2Write", Ucs2Write); - env->SetMethod(proto, "utf8Write", Utf8Write); + env->SetMethod(proto, "asciiSlice", StringSlice); + env->SetMethod(proto, "base64Slice", StringSlice); + env->SetMethod(proto, "latin1Slice", StringSlice); + env->SetMethod(proto, "hexSlice", StringSlice); + env->SetMethod(proto, "ucs2Slice", StringSlice); + env->SetMethod(proto, "utf8Slice", StringSlice); + + env->SetMethod(proto, "asciiWrite", StringWrite); + env->SetMethod(proto, "base64Write", StringWrite); + env->SetMethod(proto, "latin1Write", StringWrite); + env->SetMethod(proto, "hexWrite", StringWrite); + env->SetMethod(proto, "ucs2Write", StringWrite); + env->SetMethod(proto, "utf8Write", StringWrite); if (auto zero_fill_field = env->isolate_data()->zero_fill_field()) { CHECK(args[1]->IsObject());