porffor 0.56.8 → 0.57.0
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.
@@ -603,7 +603,7 @@ local.set ${obj+1}`;
|
|
603
603
|
} else obj = __Porffor_object_getHiddenPrototype(trueType);
|
604
604
|
|
605
605
|
// todo/opt: put this behind comptime flag if only __proto__ is used
|
606
|
-
if (hash == -406948493) if (key
|
606
|
+
if (hash == -406948493) if (Porffor.strcmp(key, '__proto__')) {
|
607
607
|
// get prototype
|
608
608
|
Porffor.wasm`
|
609
609
|
local.get ${obj}
|
@@ -679,7 +679,7 @@ export const __Porffor_object_set = (obj: any, key: any, value: any): any => {
|
|
679
679
|
let entryPtr: i32 = __Porffor_object_lookup(obj, key, hash);
|
680
680
|
let flags: i32;
|
681
681
|
if (entryPtr == -1) {
|
682
|
-
if (hash == -406948493) if (key
|
682
|
+
if (hash == -406948493) if (Porffor.strcmp(key, '__proto__')) {
|
683
683
|
// set prototype
|
684
684
|
__Porffor_object_setPrototype(obj, value);
|
685
685
|
return value;
|
@@ -785,7 +785,7 @@ export const __Porffor_object_setStrict = (obj: any, key: any, value: any): any
|
|
785
785
|
let entryPtr: i32 = __Porffor_object_lookup(obj, key, hash);
|
786
786
|
let flags: i32;
|
787
787
|
if (entryPtr == -1) {
|
788
|
-
if (hash == -406948493) if (key
|
788
|
+
if (hash == -406948493) if (Porffor.strcmp(key, '__proto__')) {
|
789
789
|
// set prototype
|
790
790
|
__Porffor_object_setPrototype(obj, value);
|
791
791
|
return value;
|
@@ -1063,7 +1063,7 @@ export const __Porffor_object_expr_init = (obj: any, key: any, value: any): void
|
|
1063
1063
|
const hash: i32 = __Porffor_object_hash(key);
|
1064
1064
|
let entryPtr: i32 = __Porffor_object_lookup(obj, key, hash);
|
1065
1065
|
if (entryPtr == -1) {
|
1066
|
-
if (hash == -406948493) if (key
|
1066
|
+
if (hash == -406948493) if (Porffor.strcmp(key, '__proto__')) {
|
1067
1067
|
// set prototype
|
1068
1068
|
__Porffor_object_setPrototype(obj, value);
|
1069
1069
|
return value;
|
@@ -86,31 +86,28 @@ export const __Porffor_miniLog = (arg: any) => {
|
|
86
86
|
Porffor.printStatic('\n');
|
87
87
|
};
|
88
88
|
|
89
|
-
export const
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
if (length) {
|
97
|
-
Porffor.printStatic('(');
|
98
|
-
print(arrLen + 1);
|
99
|
-
Porffor.printStatic(') ');
|
100
|
-
}
|
89
|
+
export const __Porffor_printArray = (arg: any[]|Uint8Array|Int8Array|Uint8ClampedArray|Uint16Array|Int16Array|Uint32Array|Int32Array|Float32Array|Float64Array, colors: boolean, length: boolean = false) => {
|
90
|
+
const arrLen: i32 = arg.length;
|
91
|
+
if (length) {
|
92
|
+
Porffor.printStatic('(');
|
93
|
+
print(arrLen);
|
94
|
+
Porffor.printStatic(') ');
|
95
|
+
}
|
101
96
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
}
|
110
|
-
Porffor.printStatic(' ]');
|
97
|
+
if (arrLen == 0) {
|
98
|
+
Porffor.printStatic('[]');
|
99
|
+
} else {
|
100
|
+
Porffor.printStatic('[ ');
|
101
|
+
for (let i: i32 = 0; i < arrLen; i++) {
|
102
|
+
__Porffor_print(arg[i], colors);
|
103
|
+
if (i != arrLen - 1) Porffor.printStatic(', ');
|
111
104
|
}
|
112
|
-
|
105
|
+
Porffor.printStatic(' ]');
|
106
|
+
}
|
107
|
+
};
|
113
108
|
|
109
|
+
export const __Porffor_print = (arg: any, colors: boolean = true, depth: number = 0) => {
|
110
|
+
// todo: Symbol.toStringTag could reduce duplication here
|
114
111
|
switch (Porffor.type(arg)) {
|
115
112
|
case Porffor.TYPES.number:
|
116
113
|
if (colors) Porffor.printStatic('\x1b[33m'); // yellow
|
@@ -4,7 +4,7 @@ export const __Function_prototype_toString = (_this: Function) => {
|
|
4
4
|
const out: bytestring = Porffor.allocate();
|
5
5
|
|
6
6
|
Porffor.bytestring.appendStr(out, 'function ');
|
7
|
-
Porffor.bytestring.appendStr(out, _this
|
7
|
+
Porffor.bytestring.appendStr(out, __Porffor_funcLut_name(_this));
|
8
8
|
Porffor.bytestring.appendStr(out, '() { [native code] }');
|
9
9
|
return out;
|
10
10
|
};
|