Skip to content

Commit

Permalink
src: remove outdated Neuter() call in node_buffer.cc
Browse files Browse the repository at this point in the history
This call was introduced in 827ee49 to avoid a crash in a
later `Neuter()` call that has later been removed in ebbbc5a,
rendering the original call unnecessary.

Refs: nodejs#3624
Refs: nodejs#5204
  • Loading branch information
addaleax committed Jan 13, 2019
1 parent c24fccf commit 98da4cc
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/node_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,6 @@ MaybeLocal<Object> New(Environment* env,
}

Local<ArrayBuffer> ab = ArrayBuffer::New(env->isolate(), data, length);
// `Neuter()`ing is required here to prevent materialization of the backing
// store in v8. `nullptr` buffers are not writable, so this is semantically
// correct.
if (data == nullptr)
ab->Neuter();
MaybeLocal<Uint8Array> ui = Buffer::New(env, ab, 0, length);

CallbackInfo::New(env->isolate(), ab, callback, data, hint);
Expand Down

0 comments on commit 98da4cc

Please sign in to comment.