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

Commit

Permalink
Remove fancy SlowBuffer constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Sep 9, 2010
1 parent ba2e4a2 commit 71d67db
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/node_buffer.cc
Expand Up @@ -248,26 +248,6 @@ Handle<Value> Buffer::New(const Arguments &args) {
buffer->length());
args.This()->Set(length_symbol, Integer::New(buffer->length_));

if (args[0]->IsString()) {
if (write_sym.IsEmpty()) {
write_sym = Persistent<String>::New(String::NewSymbol("write"));
}

Local<Value> write_v = args.This()->Get(write_sym);
assert(write_v->IsFunction());
Local<Function> write = Local<Function>::Cast(write_v);

Local<Value> argv[2] = { args[0], args[1] };

TryCatch try_catch;

write->Call(args.This(), 2, argv);

if (try_catch.HasCaught()) {
FatalException(try_catch);
}
}

return args.This();
}

Expand Down

0 comments on commit 71d67db

Please sign in to comment.