Merge pull request #1724 from tong/js-syntax

Replace __js__ with Syntax.code
This commit is contained in:
Lubos Lenco 2020-06-06 12:20:42 +02:00 committed by GitHub
commit bc2ecab27c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -78,7 +78,7 @@ class Starter {
kha.Assets.loadBlobFromPath(name, function(b: kha.Blob) {
var print = function(s:String) { trace(s); };
var loaded = function() { tasks--; start(); };
untyped __js__("(1, eval)({0})", b.toString());
js.Syntax.code("(1, eval)({0})", b.toString());
#if kha_krom
var instantiateWasm = function(imports, successCallback) {
var wasmbin = Krom.loadBlob("ammo.wasm.wasm");
@ -87,9 +87,9 @@ class Starter {
successCallback(inst);
return inst.exports;
};
untyped __js__("Ammo({print:print, instantiateWasm:instantiateWasm}).then(loaded)");
js.Syntax.code("Ammo({print:print, instantiateWasm:instantiateWasm}).then(loaded)");
#else
untyped __js__("Ammo({print:print}).then(loaded)");
js.Syntax.code("Ammo({print:print}).then(loaded)");
#end
});
}
@ -98,7 +98,7 @@ class Starter {
#if (js && arm_navigation)
function loadLib(name: String) {
kha.Assets.loadBlobFromPath(name, function(b: kha.Blob) {
untyped __js__("(1, eval)({0})", b.toString());
js.Syntax.code("(1, eval)({0})", b.toString());
tasks--;
start();
});