Comparing version 0.57.0-dev.3 to 0.57.0-dev.4
14
ligo.js
@@ -12,5 +12,11 @@ import _BLS12381 from "@ligolang/ocaml-bls12-381"; | ||
async function loadJSBundle(url) { | ||
let response = await fetch(url); | ||
let text = await response.text(); | ||
new Function(text).call(window); | ||
return new Promise((resolve) => { | ||
// TODO(prometheansacrifice) Handle error while loading JS | ||
const script = document.createElement("script"); | ||
script.src = url.pathname; | ||
script.onload = function () { | ||
resolve(); | ||
}; | ||
document.head.appendChild(script); | ||
}); | ||
} | ||
@@ -23,5 +29,5 @@ | ||
await loadJSBundle(new URL("js_main.bc.js", import.meta.url)); | ||
return compile.main(code, syntax); | ||
return window.compile.main(code, syntax); | ||
} | ||
// Cant use TS because rollup expects an es6 module at the consumer end. If necessary, also distribute an es6 export |
{ | ||
"name": "ligolang", | ||
"main": "dist/ligo.js", | ||
"module": "./ligo.js", | ||
"version": "0.57.0-dev.3", | ||
"version": "0.57.0-dev.4", | ||
"scripts": { | ||
@@ -11,3 +10,4 @@ "build": "cp ../_build/default/src/bin/js_main*.js . && chmod u+rw js_main.bc.* && rollup -c ./rollup.config.mjs" | ||
"ligo.js", | ||
"dist/ligo.js" | ||
"js_main.bc.js", | ||
"js_main.bc.runtime.js" | ||
], | ||
@@ -14,0 +14,0 @@ "dependencies": { |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
67812834
4
24093
1