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 authored and targos committed Jan 24, 2019
1 parent c0859d7 commit dbecc82
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 @@ -401,11 +401,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);

if (ui.IsEmpty()) {
Expand Down

0 comments on commit dbecc82

Please sign in to comment.