porffor 0.56.3 → 0.56.5
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/2c.js +31 -17
- package/compiler/builtins/array.ts +57 -21
- package/compiler/builtins/arraybuffer.ts +4 -6
- package/compiler/builtins/dataview.ts +2 -3
- package/compiler/builtins/date.ts +2 -5
- package/compiler/builtins/json.ts +7 -8
- package/compiler/builtins/{z_map.ts → map.ts} +26 -29
- package/compiler/builtins/object.ts +16 -23
- package/compiler/builtins/porffor.d.ts +1 -0
- package/compiler/builtins/reflect.ts +1 -2
- package/compiler/builtins/set.ts +8 -92
- package/compiler/builtins/typedarray.js +58 -18
- package/compiler/builtins/{z_weakmap.ts → weakmap.ts} +5 -9
- package/compiler/builtins/{z_weakset.ts → weakset.ts} +3 -7
- package/compiler/builtins/z_ecma262.ts +17 -21
- package/compiler/builtins_precompiled.js +725 -612
- package/compiler/codegen.js +6 -0
- package/package.json +1 -1
- package/r.cjs +101 -8
- package/runner/index.js +1 -1
- package/foo +0 -0
package/compiler/codegen.js
CHANGED
@@ -6320,6 +6320,12 @@ const generateTaggedTemplate = (scope, decl, global = false, name = undefined, v
|
|
6320
6320
|
return out;
|
6321
6321
|
},
|
6322
6322
|
|
6323
|
+
__Porffor_c: str => {
|
6324
|
+
return [
|
6325
|
+
[ null, 'c', str ]
|
6326
|
+
];
|
6327
|
+
},
|
6328
|
+
|
6323
6329
|
__Porffor_bs: str => makeString(scope, str, true),
|
6324
6330
|
__Porffor_s: str => makeString(scope, str, false)
|
6325
6331
|
};
|
package/package.json
CHANGED
package/r.cjs
CHANGED
@@ -1,16 +1,109 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
return 'Test262';
|
1
|
+
var assert = mustBeTrue => {
|
2
|
+
if (mustBeTrue === true) {
|
3
|
+
return;
|
5
4
|
}
|
6
5
|
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
throw new Test262Error('assert failed');
|
7
|
+
};
|
8
|
+
assert; // idk why exactly but this fixes many tests by forcing indirect ref
|
9
|
+
|
10
|
+
var __assert_throws = (expectedErrorConstructor, func) => {
|
11
|
+
if (typeof func !== 'function') {
|
12
|
+
throw new Test262Error('assert.throws invoked with a non-function value');
|
13
|
+
}
|
14
|
+
|
15
|
+
try {
|
16
|
+
func();
|
17
|
+
} catch {
|
18
|
+
return;
|
19
|
+
}
|
20
|
+
|
21
|
+
throw new Test262Error('assert.throws failed');
|
22
|
+
};
|
23
|
+
|
24
|
+
var __assert__isSameValue = (a, b) => {
|
25
|
+
if (a === b) {
|
26
|
+
// Handle +/-0 vs. -/+0
|
27
|
+
return a !== 0 || 1 / a === 1 / b;
|
28
|
+
}
|
29
|
+
|
30
|
+
// Handle NaN vs. NaN
|
31
|
+
return a !== a && b !== b;
|
32
|
+
};
|
33
|
+
|
34
|
+
var __assert_sameValue = (actual, expected) => {
|
35
|
+
if (assert._isSameValue(actual, expected)) {
|
36
|
+
return;
|
37
|
+
}
|
38
|
+
|
39
|
+
throw new Test262Error('assert.sameValue failed');
|
40
|
+
};
|
41
|
+
|
42
|
+
var __assert_notSameValue = (actual, unexpected) => {
|
43
|
+
if (!assert._isSameValue(actual, unexpected)) {
|
44
|
+
return;
|
45
|
+
}
|
46
|
+
|
47
|
+
throw new Test262Error('assert.notSameValue failed');
|
48
|
+
};
|
49
|
+
|
50
|
+
var typedArrayConstructors = [
|
51
|
+
Float64Array,
|
52
|
+
Float32Array,
|
53
|
+
Int32Array,
|
54
|
+
Int16Array,
|
55
|
+
Int8Array,
|
56
|
+
Uint32Array,
|
57
|
+
Uint16Array,
|
58
|
+
Uint8Array,
|
59
|
+
Uint8ClampedArray
|
60
|
+
];
|
61
|
+
|
62
|
+
function testWithTypedArrayConstructors(f, selected) {
|
63
|
+
var constructors = selected || typedArrayConstructors;
|
64
|
+
for (var i = 0; i < constructors.length; ++i) {
|
65
|
+
f(constructors[i]);
|
10
66
|
}
|
11
67
|
}
|
12
68
|
|
13
|
-
|
69
|
+
testWithTypedArrayConstructors(function(TA) {
|
70
|
+
var sample = new TA([40, 41, 42, 43]);
|
71
|
+
|
72
|
+
function testRes(result, msg) {
|
73
|
+
assert.sameValue(result.length, 4, msg);
|
74
|
+
assert.sameValue(result[0], 40, msg + " & result[0] === 40");
|
75
|
+
assert.sameValue(result[1], 41, msg + " & result[1] === 41");
|
76
|
+
assert.sameValue(result[2], 42, msg + " & result[2] === 42");
|
77
|
+
assert.sameValue(result[3], 43, msg + " & result[3] === 43");
|
78
|
+
}
|
79
|
+
|
80
|
+
testRes(sample.subarray(0), "begin == 0");
|
81
|
+
testRes(sample.subarray(-4), "begin == -srcLength");
|
82
|
+
testRes(sample.subarray(-5), "begin < -srcLength");
|
83
|
+
|
84
|
+
testRes(sample.subarray(0, 4), "begin == 0, end == srcLength");
|
85
|
+
testRes(sample.subarray(-4, 4), "begin == -srcLength, end == srcLength");
|
86
|
+
testRes(sample.subarray(-5, 4), "begin < -srcLength, end == srcLength");
|
87
|
+
|
88
|
+
testRes(sample.subarray(0, 5), "begin == 0, end > srcLength");
|
89
|
+
testRes(sample.subarray(-4, 5), "begin == -srcLength, end > srcLength");
|
90
|
+
testRes(sample.subarray(-5, 5), "begin < -srcLength, end > srcLength");
|
91
|
+
});
|
92
|
+
|
93
|
+
|
94
|
+
// class C {
|
95
|
+
// // static #method = () => 1;
|
96
|
+
// static #method() {
|
97
|
+
// return 'Test262';
|
98
|
+
// }
|
99
|
+
|
100
|
+
// static getPrivateMethod() {
|
101
|
+
// this.#method = () => 2;
|
102
|
+
// return this.#method();
|
103
|
+
// }
|
104
|
+
// }
|
105
|
+
|
106
|
+
// console.log(C.getPrivateMethod())
|
14
107
|
|
15
108
|
// var __assert_throws = (expectedErrorConstructor, func) => {
|
16
109
|
// if (typeof func !== 'function') {
|
package/runner/index.js
CHANGED
package/foo
DELETED
File without changes
|