Browse Source

NanNew() the NanNull()s

v1.x
Rod Vagg 11 years ago
parent
commit
8158158abf
  1. 8
      src/Canvas.cc
  2. 2
      src/JPEGStream.h

8
src/Canvas.cc

@ -211,7 +211,7 @@ Canvas::EIO_AfterToBuffer(eio_req *req) {
} else { } else {
Local<Object> buf = NanNewBufferHandle((char*)closure->data, closure->len); Local<Object> buf = NanNewBufferHandle((char*)closure->data, closure->len);
memcpy(Buffer::Data(buf), closure->data, closure->len); memcpy(Buffer::Data(buf), closure->data, closure->len);
Local<Value> argv[2] = { NanNull(), buf }; Local<Value> argv[2] = { NanNew(NanNull()), buf };
closure->pfn->Call(2, argv); closure->pfn->Call(2, argv);
} }
@ -348,7 +348,7 @@ streamPNG(void *c, const uint8_t *data, unsigned len) {
closure_t *closure = (closure_t *) c; closure_t *closure = (closure_t *) c;
Local<Object> buf = NanNewBufferHandle((char *)data, len); Local<Object> buf = NanNewBufferHandle((char *)data, len);
Local<Value> argv[3] = { Local<Value> argv[3] = {
NanNull() NanNew(NanNull())
, buf , buf
, NanNew<Integer>(len) }; , NanNew<Integer>(len) };
NanMakeCallback(NanGetCurrentContext()->Global(), closure->fn, 3, argv); NanMakeCallback(NanGetCurrentContext()->Global(), closure->fn, 3, argv);
@ -423,8 +423,8 @@ NAN_METHOD(Canvas::StreamPNGSync) {
NanMakeCallback(NanGetCurrentContext()->Global(), closure.fn, 1, argv); NanMakeCallback(NanGetCurrentContext()->Global(), closure.fn, 1, argv);
} else { } else {
Local<Value> argv[3] = { Local<Value> argv[3] = {
NanNull() NanNew(NanNull())
, NanNull() , NanNew(NanNull())
, NanNew<Uint32>(0) }; , NanNew<Uint32>(0) };
NanMakeCallback(NanGetCurrentContext()->Global(), closure.fn, 1, argv); NanMakeCallback(NanGetCurrentContext()->Global(), closure.fn, 1, argv);
} }

2
src/JPEGStream.h

@ -34,7 +34,7 @@ empty_closure_output_buffer(j_compress_ptr cinfo){
closure_destination_mgr *dest = (closure_destination_mgr *) cinfo->dest; closure_destination_mgr *dest = (closure_destination_mgr *) cinfo->dest;
Local<Object> buf = NanNewBufferHandle((char *)dest->buffer, dest->bufsize); Local<Object> buf = NanNewBufferHandle((char *)dest->buffer, dest->bufsize);
Local<Value> argv[3] = { Local<Value> argv[3] = {
NanNull() NanNew(NanNull())
, NanNew(buf) , NanNew(buf)
, NanNew<Integer>(dest->bufsize) , NanNew<Integer>(dest->bufsize)
}; };

Loading…
Cancel
Save