porffor 0.19.3 → 0.19.4
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/arraybuffer.ts +3 -3
- package/compiler/builtins/dataview.ts +2 -2
- package/compiler/builtins/set.ts +1 -1
- package/compiler/codegen.js +1 -1
- package/compiler/generated_builtins.js +583 -583
- package/compiler/types.js +12 -8
- package/compiler/wrap.js +4 -1
- package/package.json +1 -1
- package/runner/index.js +1 -1
package/compiler/types.js
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
export const TYPES = {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
2
|
+
empty: 0x00,
|
3
|
+
number: 0x01,
|
4
|
+
boolean: 0x02,
|
5
|
+
string: 0x03,
|
6
|
+
undefined: 0x04,
|
7
|
+
object: 0x05,
|
8
|
+
function: 0x06,
|
9
|
+
symbol: 0x07,
|
10
|
+
bigint: 0x08
|
10
11
|
};
|
11
12
|
|
12
13
|
// flags
|
@@ -19,7 +20,10 @@ export const TYPE_FLAGS = {
|
|
19
20
|
// TYPES.string |= TYPE_FLAGS.iterable;
|
20
21
|
TYPES.string |= TYPE_FLAGS.length;
|
21
22
|
|
23
|
+
TYPES.undefined = TYPES.empty | TYPE_FLAGS.parity;
|
24
|
+
|
22
25
|
export const TYPE_NAMES = {
|
26
|
+
[TYPES.empty]: 'empty',
|
23
27
|
[TYPES.number]: 'Number',
|
24
28
|
[TYPES.boolean]: 'Boolean',
|
25
29
|
[TYPES.string]: 'String',
|
package/compiler/wrap.js
CHANGED
@@ -27,8 +27,11 @@ export const writeByteStr = (memory, ptr, str) => {
|
|
27
27
|
|
28
28
|
const porfToJSValue = ({ memory, funcs, pages }, value, type) => {
|
29
29
|
switch (type) {
|
30
|
+
case TYPES.empty:
|
31
|
+
case TYPES.undefined:
|
32
|
+
return undefined;
|
33
|
+
|
30
34
|
case TYPES.boolean: return Boolean(value);
|
31
|
-
case TYPES.undefined: return undefined;
|
32
35
|
case TYPES.object: return value === 0 ? null : {};
|
33
36
|
|
34
37
|
case TYPES.function: {
|
package/package.json
CHANGED