summaryrefslogtreecommitdiff
path: root/src/node_buffer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/node_buffer.cc')
-rw-r--r--src/node_buffer.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/node_buffer.cc b/src/node_buffer.cc
index 3cd047c0e7..d87d38334a 100644
--- a/src/node_buffer.cc
+++ b/src/node_buffer.cc
@@ -229,6 +229,18 @@ MaybeLocal<Uint8Array> New(Environment* env,
return ui;
}
+MaybeLocal<Uint8Array> New(Isolate* isolate,
+ Local<ArrayBuffer> ab,
+ size_t byte_offset,
+ size_t length) {
+ Environment* env = Environment::GetCurrent(isolate);
+ if (env == nullptr) {
+ THROW_ERR_BUFFER_CONTEXT_NOT_AVAILABLE(isolate);
+ return MaybeLocal<Uint8Array>();
+ }
+ return New(env, ab, byte_offset, length);
+}
+
MaybeLocal<Object> New(Isolate* isolate,
Local<String> string,