mirror of
https://github.com/fluencelabs/musl
synced 2025-04-25 07:12:15 +00:00
Support node.js in wasm loader
The latest LTS of Node supports wasm, and this allows us to test against it, as well as the shells.
This commit is contained in:
parent
e43efbe62d
commit
4b606b59d4
@ -28,6 +28,20 @@ var heap;
|
|||||||
var heap_uint8;
|
var heap_uint8;
|
||||||
var heap_uint32;
|
var heap_uint32;
|
||||||
|
|
||||||
|
if (typeof process === 'object' && typeof require === 'function') { // This is node.js
|
||||||
|
// Emulate JS shell behavior used below
|
||||||
|
const nodeFS = require('fs');
|
||||||
|
const nodePath = require('path');
|
||||||
|
var read = function(file_path) {
|
||||||
|
filename = nodePath['normalize'](file_path);
|
||||||
|
console.log(file_path);
|
||||||
|
console.log(filename);
|
||||||
|
return nodeFS['readFileSync'](filename);
|
||||||
|
}
|
||||||
|
var print = console.log;
|
||||||
|
arguments = process['argv'].slice(2);
|
||||||
|
}
|
||||||
|
|
||||||
function setHeap(h) {
|
function setHeap(h) {
|
||||||
heap = h
|
heap = h
|
||||||
heap_uint8 = new Uint8Array(heap);
|
heap_uint8 = new Uint8Array(heap);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user