Implement Math/Mathf.pow

This commit is contained in:
dcodeIO
2018-03-26 03:50:06 +02:00
parent e26734ef90
commit e75d006d26
18 changed files with 10062 additions and 988 deletions

View File

@ -109,21 +109,25 @@ tests.forEach(filename => {
// Instantiate
try {
let exports = new WebAssembly.Instance(new WebAssembly.Module(stdout.toBuffer()), {
env: {
abort: function(msg, file, line, column) {
// TODO
let runTime = asc.measure(() => {
let exports = new WebAssembly.Instance(new WebAssembly.Module(stdout.toBuffer()), {
env: {
abort: function(msg, file, line, column) {
// TODO
},
externalFunction: function() { },
externalConstant: 1,
logi: function(i) { console.log("logi: " + i); },
logf: function(f) { console.log("logf: " + f); }
},
externalFunction: function() { },
externalConstant: 1
},
my: {
externalFunction: function() { },
externalConstant: 2
},
JSMath: Math
my: {
externalFunction: function() { },
externalConstant: 2
},
JSMath: Math
});
});
console.log("- " + chalk.green("instantiate OK"));
console.log("- " + chalk.green("instantiate OK") + " (" + asc.formatTime(runTime) + ")");
} catch (e) {
console.log("- " + chalk.red("instantiate ERROR: ") + e);
failed = true;