porffor 0.19.6 → 0.19.7
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/codegen.js +4 -9
- package/package.json +1 -1
- package/runner/index.js +1 -1
package/compiler/codegen.js
CHANGED
@@ -1231,12 +1231,7 @@ const asmFunc = (name, { wasm, params, locals: localTypes, globals: globalTypes
|
|
1231
1231
|
return func;
|
1232
1232
|
};
|
1233
1233
|
|
1234
|
-
const includeBuiltin = (scope, builtin) =>
|
1235
|
-
const code = builtinFuncs[builtin];
|
1236
|
-
if (code.wasm) return asmFunc(builtin, code);
|
1237
|
-
|
1238
|
-
return code.body.map(x => generate(scope, x));
|
1239
|
-
};
|
1234
|
+
const includeBuiltin = (scope, builtin) => asmFunc(builtin, builtinFuncs[builtin]);
|
1240
1235
|
|
1241
1236
|
const generateLogicExp = (scope, decl) => {
|
1242
1237
|
return performLogicOp(scope, decl.operator, generate(scope, decl.left), generate(scope, decl.right), getNodeType(scope, decl.left), getNodeType(scope, decl.right));
|
@@ -4243,8 +4238,8 @@ const generateArray = (scope, decl, global = false, name = '$undeclared', initEm
|
|
4243
4238
|
};
|
4244
4239
|
|
4245
4240
|
const generateObject = (scope, decl, global = false, name = '$undeclared') => {
|
4246
|
-
|
4247
|
-
|
4241
|
+
includeBuiltin(scope, 'Map');
|
4242
|
+
includeBuiltin(scope, '__Map_prototype_set');
|
4248
4243
|
|
4249
4244
|
// todo: optimize const objects
|
4250
4245
|
const tmp = localTmp(scope, `#objectexpr${randId()}`);
|
@@ -4262,7 +4257,7 @@ const generateObject = (scope, decl, global = false, name = '$undeclared') => {
|
|
4262
4257
|
|
4263
4258
|
for (const x of decl.properties) {
|
4264
4259
|
const { method, shorthand, computed, kind, key, value } = x;
|
4265
|
-
if (
|
4260
|
+
if (kind !== 'init') return todo(scope, 'complex objects are not supported yet', true);
|
4266
4261
|
|
4267
4262
|
const k = computed ? key : {
|
4268
4263
|
type: 'Literal',
|
package/package.json
CHANGED