summaryrefslogtreecommitdiff
path: root/src/string_bytes.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/string_bytes.cc')
-rw-r--r--src/string_bytes.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/string_bytes.cc b/src/string_bytes.cc
index 0bdb8aad91..36525a73ac 100644
--- a/src/string_bytes.cc
+++ b/src/string_bytes.cc
@@ -19,6 +19,7 @@ using v8::Handle;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
+using v8::Object;
using v8::String;
using v8::Value;
@@ -702,7 +703,10 @@ Local<Value> StringBytes::Encode(Isolate* isolate,
Local<String> val;
switch (encoding) {
case BUFFER:
- return scope.Escape(Buffer::New(isolate, buf, buflen));
+ {
+ Local<Object> vbuf = Buffer::New(isolate, buf, buflen).ToLocalChecked();
+ return scope.Escape(vbuf);
+ }
case ASCII:
if (contains_non_ascii(buf, buflen)) {