Skip to content

Instantly share code, notes, and snippets.

@tjfontaine
Created April 7, 2014 22:59
Show Gist options
  • Select an option

  • Save tjfontaine/10071300 to your computer and use it in GitHub Desktop.

Select an option

Save tjfontaine/10071300 to your computer and use it in GitHub Desktop.
diff --git a/src/shim.cc b/src/shim.cc
index 88f5494..a7fae99 100644
--- a/src/shim.cc
+++ b/src/shim.cc
@@ -1451,7 +1451,9 @@ shim_buffer_new_external(shim_ctx_s* ctx, char* data, size_t len,
#if NODE_VERSION_AT_LEAST(0, 11, 3)
return new shim_val_s(node::Buffer::New(data, len, cb, hint));
#else
- return new shim_val_s(SHIM__TO_LOCAL(Buffer::New(data, len, cb, hint)->handle_));
+ Buffer* buf = Buffer::New(data, len, cb, hint);
+ shim_val_s* tmp = new shim_val_s(Local<Object>::New(buf->handle_));
+ return tmp;
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment