Skip to content
This repository was archived by the owner on Jul 3, 2020. It is now read-only.

Commit 1a7cb7a

Browse files
author
Face Kapow
committed
Fix libsodium to export with getSystemResources
1 parent 612be4d commit 1a7cb7a

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

js/core/libsodium.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ for (var i = 0; i < justConvertHex.length; i++) {
8282
module.exports[justConvertHex[i].funcName] = function(data) {
8383
var result = lib[justConvertHex[i].funcName](data);
8484
if (!result) {
85-
throw new Error(justConvertHex[i].funcName + ': ' + justConvertHex[i].errprInfo);
85+
throw new Error(justConvertHex[i].funcName + ': ' + justConvertHex[i].errorInfo);
8686
}
8787
return hexToU8(result);
8888
}

src/kernel/native-object.cc

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -385,13 +385,6 @@ NATIVE_FUNCTION(NativesObject, SystemInfo) {
385385
obj->Set(context, s_events_count, v8::Uint32::NewFromUnsigned(iv8, ev_count));
386386
}
387387

388-
{
389-
LOCAL_V8STRING(s_libsodium, "libsodium");
390-
obj->Set(context, s_libsodium, (new LibsodiumObject())
391-
->BindToTemplateCache(th->template_cache())
392-
->GetInstance());
393-
}
394-
395388
args.GetReturnValue().Set(obj);
396389
}
397390

@@ -452,6 +445,7 @@ NATIVE_FUNCTION(NativesObject, GetSystemResources) {
452445
LOCAL_V8STRING(s_memory_range, "memoryRange");
453446
LOCAL_V8STRING(s_io_range, "ioRange");
454447
LOCAL_V8STRING(s_irq_range, "irqRange");
448+
LOCAL_V8STRING(s_libsodium, "libsodium");
455449

456450
v8::Local<v8::Object> obj = v8::Object::New(iv8);
457451

@@ -467,6 +461,10 @@ NATIVE_FUNCTION(NativesObject, GetSystemResources) {
467461
->BindToTemplateCache(th->template_cache())
468462
->GetInstance());
469463

464+
obj->Set(context, s_libsodium, (new LibsodiumObject())
465+
->BindToTemplateCache(th->template_cache())
466+
->GetInstance());
467+
470468
args.GetReturnValue().Set(obj);
471469
}
472470

0 commit comments

Comments
 (0)