porffor 0.28.0 → 0.28.1
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.js +0 -12
- package/compiler/builtins_precompiled.js +177 -177
- package/compiler/codegen.js +14 -3
- package/package.json +1 -1
- package/runner/index.js +1 -1
package/compiler/codegen.js
CHANGED
@@ -1486,7 +1486,7 @@ const getNodeType = (scope, node) => {
|
|
1486
1486
|
if (scope.locals['#last_type']) return getLastType(scope);
|
1487
1487
|
|
1488
1488
|
// presume
|
1489
|
-
|
1489
|
+
if (Prefs.warnAssumedType) console.warn(`Indirect call assumed to be number`);
|
1490
1490
|
return TYPES.number;
|
1491
1491
|
}
|
1492
1492
|
|
@@ -1524,7 +1524,7 @@ const getNodeType = (scope, node) => {
|
|
1524
1524
|
if (scope.locals['#last_type']) return getLastType(scope);
|
1525
1525
|
|
1526
1526
|
// presume
|
1527
|
-
|
1527
|
+
if (Prefs.warnAssumedType) console.warn(`Call to ${name} assumed to be number`);
|
1528
1528
|
return TYPES.number;
|
1529
1529
|
|
1530
1530
|
// let protoFunc;
|
@@ -1633,6 +1633,7 @@ const getNodeType = (scope, node) => {
|
|
1633
1633
|
if (scope.locals['#last_type']) return getLastType(scope);
|
1634
1634
|
|
1635
1635
|
// presume
|
1636
|
+
if (Prefs.warnAssumedType) console.warn(`Member access to field .${name} assumed to be number`);
|
1636
1637
|
return TYPES.number;
|
1637
1638
|
}
|
1638
1639
|
|
@@ -1664,7 +1665,7 @@ const getNodeType = (scope, node) => {
|
|
1664
1665
|
if (scope.locals['#last_type']) return getLastType(scope);
|
1665
1666
|
|
1666
1667
|
// presume
|
1667
|
-
|
1668
|
+
if (Prefs.warnAssumedType) console.warn(`AST node ${node.type} assumed to be number`);
|
1668
1669
|
return TYPES.number;
|
1669
1670
|
})();
|
1670
1671
|
|
@@ -5570,6 +5571,16 @@ const internalConstrs = {
|
|
5570
5571
|
type: TYPES.undefined,
|
5571
5572
|
notConstr: true,
|
5572
5573
|
length: 1
|
5574
|
+
},
|
5575
|
+
|
5576
|
+
__Porffor_rawType: {
|
5577
|
+
generate: (scope, decl) => [
|
5578
|
+
...getNodeType(scope, decl.arguments[0]),
|
5579
|
+
Opcodes.i32_from_u
|
5580
|
+
],
|
5581
|
+
type: TYPES.number,
|
5582
|
+
notConstr: true,
|
5583
|
+
length: 1
|
5573
5584
|
}
|
5574
5585
|
};
|
5575
5586
|
|
package/package.json
CHANGED