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: #3624
Refs: #5204

PR-URL: #25479
Reviewed-By: Anatoli Papirovski <[email protected]>
  • Loading branch information
addaleax committed Jan 21, 2019
1 parent 6708011 commit 30f4568
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 @@ -403,11 +403,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 30f4568

Please sign in to comment.