Skip to content

Commit bf71d1f

Browse files
committed
nodejs - fix 'variable length array of non-POD element type'
Signed-off-by: Matthew Wright <[email protected]>
1 parent 09cdaa8 commit bf71d1f

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

wrappers/nodejs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "indy-sdk",
3-
"version": "0.2.2",
3+
"version": "0.2.4",
44
"description": "Native bindings for hyperledger indy",
55
"author": "hyperledger",
66
"license": "Apache-2.0",

wrappers/nodejs/src/indy.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,12 @@ class IndyCallback : public Nan::AsyncResource {
179179
IndyCallback* icb = static_cast<IndyCallback*>(async->data);
180180
icbmap.erase(icb->handle);
181181

182-
int argc = icb->type == CB_NONE ? 1 : 2;
183-
184182
v8::Local<v8::Array> tuple;
185-
v8::Local<v8::Value> argv[argc];
183+
v8::Local<v8::Value> argv[2];
186184
argv[0] = Nan::New<v8::Number>(icb->err);
187185
switch(icb->type){
188186
case CB_NONE:
189-
// nothing
187+
argv[1] = Nan::Null();
190188
break;
191189
case CB_STRING:
192190
argv[1] = Nan::New<v8::String>(icb->str0).ToLocalChecked();
@@ -233,7 +231,7 @@ class IndyCallback : public Nan::AsyncResource {
233231

234232
v8::Local<v8::Object> target = Nan::New<v8::Object>();
235233
v8::Local<v8::Function> callback = Nan::New(icb->callback);
236-
icb->runInAsyncScope(target, callback, argc, argv);
234+
icb->runInAsyncScope(target, callback, 2, argv);
237235

238236
uv_close(reinterpret_cast<uv_handle_t*>(&icb->uvHandle), onUvHandleClose);
239237
}

wrappers/nodejs/test/pool.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ test('pool', async function (t) {
1717

1818
t.is(await indy.createPoolLedgerConfig(pool.name, {
1919
'genesis_txn': pool.file
20-
}), void 0)
20+
}), null)
2121

2222
var poolH = await indy.openPoolLedger(pool.name, 'null')
2323
t.truthy(poolH >= 0)

0 commit comments

Comments
 (0)