summaryrefslogtreecommitdiff
path: root/src/node_internals.h
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2019-02-17 21:19:53 +0100
committerDaniel Bevenius <daniel.bevenius@gmail.com>2019-02-21 07:23:30 +0100
commit24f3f1160659ebb83416a2c779abf9d0e87ed0d6 (patch)
treef35f81cedca043afb162e257aa71415e450b9356 /src/node_internals.h
parent70b13c28c940725a953168105ce55c0966fc0a20 (diff)
downloadandroid-node-v8-24f3f1160659ebb83416a2c779abf9d0e87ed0d6.tar.gz
android-node-v8-24f3f1160659ebb83416a2c779abf9d0e87ed0d6.tar.bz2
android-node-v8-24f3f1160659ebb83416a2c779abf9d0e87ed0d6.zip
src: move function from header to source file
This particular Buffer::New() overload used to live in node_internals.h to work around a cyclic header dependency (IIRC) but that is no longer necessary. PR-URL: https://github.com/nodejs/node/pull/26173 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'src/node_internals.h')
-rw-r--r--src/node_internals.h14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/node_internals.h b/src/node_internals.h
index 367df26c0e..6f09708371 100644
--- a/src/node_internals.h
+++ b/src/node_internals.h
@@ -128,20 +128,6 @@ v8::MaybeLocal<v8::Object> New(Environment* env,
// Mixing operator new and free() is undefined behavior so don't do that.
v8::MaybeLocal<v8::Object> New(Environment* env, char* data, size_t length);
-inline
-v8::MaybeLocal<v8::Uint8Array> New(Environment* env,
- v8::Local<v8::ArrayBuffer> ab,
- size_t byte_offset,
- size_t length) {
- v8::Local<v8::Uint8Array> ui = v8::Uint8Array::New(ab, byte_offset, length);
- CHECK(!env->buffer_prototype_object().IsEmpty());
- v8::Maybe<bool> mb =
- ui->SetPrototype(env->context(), env->buffer_prototype_object());
- if (mb.IsNothing())
- return v8::MaybeLocal<v8::Uint8Array>();
- return ui;
-}
-
// Construct a Buffer from a MaybeStackBuffer (and also its subclasses like
// Utf8Value and TwoByteValue).
// If |buf| is invalidated, an empty MaybeLocal is returned, and nothing is