porffor 0.37.7 → 0.37.8
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/builtins_precompiled.js +827 -827
- package/compiler/codegen.js +7 -3
- package/package.json +1 -1
- package/runner/index.js +1 -1
package/compiler/codegen.js
CHANGED
@@ -2964,6 +2964,7 @@ const generateVarDstr = (scope, kind, pattern, init, defaultValue, global) => {
|
|
2964
2964
|
|
2965
2965
|
const typed = typedInput && pattern.typeAnnotation;
|
2966
2966
|
let idx = allocVar(scope, name, global, !(typed && extractTypeAnnotation(pattern).type != null));
|
2967
|
+
addVarMetadata(scope, name, global, { kind });
|
2967
2968
|
|
2968
2969
|
if (typed) {
|
2969
2970
|
addVarMetadata(scope, name, global, extractTypeAnnotation(pattern));
|
@@ -3563,6 +3564,9 @@ const generateAssign = (scope, decl, _global, _name, valueUnused = false) => {
|
|
3563
3564
|
];
|
3564
3565
|
}
|
3565
3566
|
|
3567
|
+
// check not const
|
3568
|
+
if (local.metadata?.kind === 'const') return internalThrow(scope, 'TypeError', `Cannot assign to constant variable ${name}`, true);
|
3569
|
+
|
3566
3570
|
if (op === '=') {
|
3567
3571
|
return setLocalWithType(scope, name, isGlobal, decl.right, true);
|
3568
3572
|
}
|
@@ -6274,9 +6278,9 @@ export default program => {
|
|
6274
6278
|
// run callbacks
|
6275
6279
|
const wasm = f.wasm;
|
6276
6280
|
for (let j = 0; j < wasm.length; j++) {
|
6277
|
-
const
|
6278
|
-
if (
|
6279
|
-
wasm.splice(j
|
6281
|
+
const o = wasm[j];
|
6282
|
+
if (o[0] === null && typeof o[1] === 'function') {
|
6283
|
+
wasm.splice(j--, 1, ...o[1]());
|
6280
6284
|
}
|
6281
6285
|
}
|
6282
6286
|
|
package/package.json
CHANGED