porffor 0.28.8 → 0.28.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiler/assemble.js +3 -0
- package/compiler/builtins_precompiled.js +154 -154
- package/compiler/codegen.js +1 -1
- package/compiler/precompile.js +4 -1
- package/package.json +1 -1
- package/runner/index.js +1 -1
package/compiler/codegen.js
CHANGED
@@ -5500,7 +5500,7 @@ const objectHack = node => {
|
|
5500
5500
|
};
|
5501
5501
|
|
5502
5502
|
const generateFunc = (scope, decl) => {
|
5503
|
-
const name = decl.id ? decl.id.name :
|
5503
|
+
const name = decl.id ? decl.id.name : `#anonymous${uniqId()}`;
|
5504
5504
|
const params = decl.params ?? [];
|
5505
5505
|
|
5506
5506
|
// TODO: share scope/locals between !!!
|
package/compiler/precompile.js
CHANGED
@@ -216,7 +216,10 @@ ${funcs.map(x => {
|
|
216
216
|
|
217
217
|
const locals = Object.entries(x.locals).sort((a,b) => a[1].idx - b[1].idx)
|
218
218
|
|
219
|
-
|
219
|
+
// todo: check for other identifier unsafe characters
|
220
|
+
const name = x.name.includes('#') ? `['${x.name}']` : `.${x.name}`;
|
221
|
+
|
222
|
+
return ` this${name} = {
|
220
223
|
wasm: ${rewriteWasm(x.wasm)},
|
221
224
|
params: ${JSON.stringify(x.params)}, typedParams: 1,
|
222
225
|
returns: ${JSON.stringify(x.returns)}, ${x.returnType != null ? `returnType: ${JSON.stringify(x.returnType)}` : 'typedReturns: 1'},
|
package/package.json
CHANGED