mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 15:31:42 +00:00
Update lib/wamr.js
This commit is contained in:
parent
bc88f76d32
commit
be87627789
|
@ -1,4 +0,0 @@
|
|||
@echo off
|
||||
xcopy /s welsonjs\* %SYSTEMDRIVE%\welsonjs\
|
||||
pushd %SYSTEMDRIVE%\welsonjs
|
||||
bootstrap.bat
|
|
@ -1,2 +0,0 @@
|
|||
@echo off
|
||||
copy /b "bin\7zs.sfx" + 7zs_config.txt + "..\\welsonjs.7z" "..\\welsonjs-portable.exe"
|
|
@ -1,5 +0,0 @@
|
|||
;!@Install@!UTF-8!
|
||||
Title="WelsonJS Portable"
|
||||
BeginPrompt="Do you want start WelsonJS Potable?"
|
||||
RunProgram="welsonjs\\bootstrap.bat"
|
||||
;!@InstallEnd@!
|
58
lib/wamr.js
Normal file
58
lib/wamr.js
Normal file
|
@ -0,0 +1,58 @@
|
|||
// WAMR for WelsonJS
|
||||
// - WAMR: https://github.com/bytecodealliance/wasm-micro-runtime
|
||||
// - WelsonJS: https://github.com/gnh1201/welsonjs
|
||||
|
||||
var SHELL = require("lib/shell");
|
||||
|
||||
var WAMRObject = function() {
|
||||
this.binPath = "bin\\iwasm";
|
||||
|
||||
this.verbose = 0;
|
||||
this.stackSize = 0;
|
||||
this.heapSize = 0;
|
||||
this.repl = false;
|
||||
this.env = {};
|
||||
this.dirs = [];
|
||||
|
||||
this.exec = function(f1, f2) {
|
||||
var cmd = [];
|
||||
|
||||
cmd.push(binPath);
|
||||
|
||||
if (this.verbose > 0) {
|
||||
cmd.push("-v=" + this.verbose);
|
||||
}
|
||||
|
||||
if (this.stackSize > 0) {
|
||||
cmd.push("--stack-size=" + this.stackSize);
|
||||
}
|
||||
|
||||
if (this.heapSize > 0) {
|
||||
cmd.push("--heap-size=" + this.heapsize);
|
||||
}
|
||||
|
||||
if (Object.keys(env).length > 0) {
|
||||
for (var k in env) {
|
||||
cmd.push("--env=\"" + k + "=" + env[k] + "\"");
|
||||
}
|
||||
}
|
||||
|
||||
if (dirs.length > 0) {
|
||||
for (var i = 0; i < dirs.length; i++) {
|
||||
cmd.push("--dir=" + dirs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof f2 !== "undefined") {
|
||||
cmd.push("--function-name=" + f2);
|
||||
}
|
||||
|
||||
cmd.push(f1);
|
||||
|
||||
return SHELL.exec(cmd);
|
||||
};
|
||||
};
|
||||
|
||||
exports.create = function() {
|
||||
return new WAMRObject();
|
||||
};
|
25
lib/wasm.js
25
lib/wasm.js
|
@ -1,25 +0,0 @@
|
|||
// WebAssembly Module for WelsonJS (Based on Microsoft JScript)
|
||||
|
||||
var WebAssemblyObject = function() {
|
||||
this.instantiate = function(bufferSource, importObject) {
|
||||
// ... todo ...
|
||||
};
|
||||
|
||||
this.instantiateStreaming = function(source, importObject) {
|
||||
// ... todo ...
|
||||
};
|
||||
|
||||
this.compile = function(bufferSource) {
|
||||
// ... todo ...
|
||||
};
|
||||
|
||||
this.compileStreaming = function(source) {
|
||||
// ... todo ...
|
||||
};
|
||||
|
||||
this.validate = function(bufferSource) {
|
||||
// ... todo ...
|
||||
};
|
||||
};
|
||||
|
||||
exports.WebAssembly = new WebAssemblyObject();
|
Loading…
Reference in New Issue
Block a user