summaryrefslogtreecommitdiff
path: root/src/tls_wrap.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/tls_wrap.cc')
-rw-r--r--src/tls_wrap.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc
index cde5419b9c..e9fe969358 100644
--- a/src/tls_wrap.cc
+++ b/src/tls_wrap.cc
@@ -187,9 +187,9 @@ void TLSWrap::Receive(const FunctionCallbackInfo<Value>& args) {
TLSWrap* wrap;
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
- CHECK(Buffer::HasInstance(args[0]));
- char* data = Buffer::Data(args[0]);
- size_t len = Buffer::Length(args[0]);
+ ArrayBufferViewContents<char> buffer(args[0]);
+ const char* data = buffer.data();
+ size_t len = buffer.length();
Debug(wrap, "Receiving %zu bytes injected from JS", len);
// Copy given buffer entirely or partiall if handle becomes closed