xbintsc 0.3.14 → 0.3.16

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.
Files changed (201) hide show
  1. package/README.md +22 -22
  2. package/README.zh-CN.md +20 -19
  3. package/bin/xbintsc.js +1 -2
  4. package/dist/src/cli/main.js +8 -5
  5. package/dist/src/cli/main.js.map +1 -1
  6. package/dist/src/codegen/generator/state.js +8 -0
  7. package/dist/src/codegen/generator/state.js.map +1 -1
  8. package/dist/src/codegen/generator/tables.d.ts +5 -6
  9. package/dist/src/codegen/generator/tables.js +13 -6
  10. package/dist/src/codegen/generator/tables.js.map +1 -1
  11. package/dist/src/driver/bundler/graph.d.ts +8 -0
  12. package/dist/src/driver/bundler/graph.js +85 -0
  13. package/dist/src/driver/bundler/graph.js.map +1 -0
  14. package/dist/src/driver/bundler/merge.d.ts +11 -0
  15. package/dist/src/driver/bundler/merge.js +288 -0
  16. package/dist/src/driver/bundler/merge.js.map +1 -0
  17. package/dist/src/driver/bundler/resolve.d.ts +12 -0
  18. package/dist/src/driver/bundler/resolve.js +246 -0
  19. package/dist/src/driver/bundler/resolve.js.map +1 -0
  20. package/dist/src/driver/bundler/symbols.d.ts +15 -0
  21. package/dist/src/driver/bundler/symbols.js +51 -0
  22. package/dist/src/driver/bundler/symbols.js.map +1 -0
  23. package/dist/src/driver/bundler/types.d.ts +36 -0
  24. package/dist/src/driver/bundler/types.js +5 -0
  25. package/dist/src/driver/bundler/types.js.map +1 -0
  26. package/dist/src/driver/index.d.ts +1 -2
  27. package/dist/src/driver/index.js +1 -2
  28. package/dist/src/driver/index.js.map +1 -1
  29. package/dist/src/driver/modules.d.ts +9 -16
  30. package/dist/src/driver/modules.js +8 -644
  31. package/dist/src/driver/modules.js.map +1 -1
  32. package/dist/src/driver/paths.d.ts +0 -9
  33. package/dist/src/driver/paths.js +0 -31
  34. package/dist/src/driver/paths.js.map +1 -1
  35. package/dist/src/driver/toolchain-provider.d.ts +10 -10
  36. package/dist/src/driver/toolchain-provider.js +9 -38
  37. package/dist/src/driver/toolchain-provider.js.map +1 -1
  38. package/dist/src/driver/toolchain.js +8 -2
  39. package/dist/src/driver/toolchain.js.map +1 -1
  40. package/dist/src/extensions/catalog.js +2 -1
  41. package/dist/src/extensions/catalog.js.map +1 -1
  42. package/dist/src/extensions/gui/index.d.ts +24 -0
  43. package/dist/src/extensions/gui/index.js +101 -0
  44. package/dist/src/extensions/gui/index.js.map +1 -0
  45. package/dist/src/extensions/native.d.ts +2 -3
  46. package/dist/src/extensions/native.js +2 -3
  47. package/dist/src/extensions/native.js.map +1 -1
  48. package/dist/tests/driver/paths.test.js +1 -9
  49. package/dist/tests/driver/paths.test.js.map +1 -1
  50. package/dist/tests/driver/toolchain-provider.test.js +12 -79
  51. package/dist/tests/driver/toolchain-provider.test.js.map +1 -1
  52. package/dist/tests/e2e/compile-basics.test.d.ts +4 -0
  53. package/dist/tests/e2e/compile-basics.test.js +134 -0
  54. package/dist/tests/e2e/compile-basics.test.js.map +1 -0
  55. package/dist/tests/e2e/compile-builtins.test.d.ts +4 -0
  56. package/dist/tests/e2e/compile-builtins.test.js +191 -0
  57. package/dist/tests/e2e/compile-builtins.test.js.map +1 -0
  58. package/dist/tests/e2e/compile-control-flow.test.d.ts +4 -0
  59. package/dist/tests/e2e/compile-control-flow.test.js +190 -0
  60. package/dist/tests/e2e/compile-control-flow.test.js.map +1 -0
  61. package/dist/tests/e2e/compile-modules.test.d.ts +4 -0
  62. package/dist/tests/e2e/compile-modules.test.js +48 -0
  63. package/dist/tests/e2e/compile-modules.test.js.map +1 -0
  64. package/dist/tests/e2e/compile-objects-classes.test.d.ts +4 -0
  65. package/dist/tests/e2e/compile-objects-classes.test.js +362 -0
  66. package/dist/tests/e2e/compile-objects-classes.test.js.map +1 -0
  67. package/dist/tests/e2e/differential-helpers.d.ts +12 -0
  68. package/dist/tests/e2e/differential-helpers.js +16 -0
  69. package/dist/tests/e2e/differential-helpers.js.map +1 -0
  70. package/dist/tests/e2e/differential-language.test.d.ts +4 -0
  71. package/dist/tests/e2e/{differential.test.js → differential-language.test.js} +5 -287
  72. package/dist/tests/e2e/differential-language.test.js.map +1 -0
  73. package/dist/tests/e2e/differential-symbols.test.d.ts +4 -0
  74. package/dist/tests/e2e/differential-symbols.test.js +92 -0
  75. package/dist/tests/e2e/differential-symbols.test.js.map +1 -0
  76. package/dist/tests/e2e/differential-values.test.d.ts +4 -0
  77. package/dist/tests/e2e/differential-values.test.js +197 -0
  78. package/dist/tests/e2e/differential-values.test.js.map +1 -0
  79. package/dist/tests/e2e/gui.test.d.ts +12 -0
  80. package/dist/tests/e2e/gui.test.js +493 -0
  81. package/dist/tests/e2e/gui.test.js.map +1 -0
  82. package/dist/tests/e2e/native-extensions.test.d.ts +4 -5
  83. package/dist/tests/e2e/native-extensions.test.js +6 -7
  84. package/dist/tests/e2e/native-extensions.test.js.map +1 -1
  85. package/dist/tests/e2e/runtime-coverage-buffer.test.d.ts +4 -0
  86. package/dist/tests/e2e/runtime-coverage-buffer.test.js +97 -0
  87. package/dist/tests/e2e/runtime-coverage-buffer.test.js.map +1 -0
  88. package/dist/tests/e2e/runtime-coverage-globals.test.d.ts +4 -0
  89. package/dist/tests/e2e/runtime-coverage-globals.test.js +149 -0
  90. package/dist/tests/e2e/runtime-coverage-globals.test.js.map +1 -0
  91. package/dist/tests/e2e/runtime-coverage-node-modules.test.d.ts +4 -0
  92. package/dist/tests/e2e/runtime-coverage-node-modules.test.js +177 -0
  93. package/dist/tests/e2e/runtime-coverage-node-modules.test.js.map +1 -0
  94. package/dist/tests/e2e/runtime-coverage-streams.test.d.ts +4 -0
  95. package/dist/tests/e2e/runtime-coverage-streams.test.js +161 -0
  96. package/dist/tests/e2e/runtime-coverage-streams.test.js.map +1 -0
  97. package/dist/tests/e2e/runtime-coverage-system.test.d.ts +4 -0
  98. package/dist/tests/e2e/runtime-coverage-system.test.js +91 -0
  99. package/dist/tests/e2e/runtime-coverage-system.test.js.map +1 -0
  100. package/dist/tests/e2e/timers.test.d.ts +7 -0
  101. package/dist/tests/e2e/timers.test.js +63 -0
  102. package/dist/tests/e2e/timers.test.js.map +1 -0
  103. package/package.json +2 -2
  104. package/runtime/ext_gui/css.cpp +743 -0
  105. package/runtime/ext_gui/css.h +98 -0
  106. package/runtime/ext_gui/document.cpp +264 -0
  107. package/runtime/ext_gui/document.h +89 -0
  108. package/runtime/ext_gui/dom.cpp +472 -0
  109. package/runtime/ext_gui/dom.h +71 -0
  110. package/runtime/ext_gui/gui.cpp +457 -0
  111. package/runtime/ext_gui/gui_engine.h +81 -0
  112. package/runtime/ext_gui/image.cpp +125 -0
  113. package/runtime/ext_gui/image.h +42 -0
  114. package/runtime/ext_gui/layout.cpp +748 -0
  115. package/runtime/ext_gui/layout.h +93 -0
  116. package/runtime/ext_gui/paint.cpp +137 -0
  117. package/runtime/ext_gui/paint.h +75 -0
  118. package/runtime/ext_gui/renderer.cpp +959 -0
  119. package/runtime/ext_gui/renderer.h +68 -0
  120. package/runtime/ext_gui/stb_image.h +7988 -0
  121. package/runtime/ext_gui/style.cpp +771 -0
  122. package/runtime/ext_gui/style.h +117 -0
  123. package/runtime/ext_gui/text.cpp +378 -0
  124. package/runtime/ext_gui/text.h +78 -0
  125. package/runtime/ext_gui/window.cpp +405 -0
  126. package/runtime/ext_node/fs/fs_common.h +13 -527
  127. package/runtime/ext_node/fs/meta_ops.c +3 -3
  128. package/runtime/ext_node/fs/parts/buffer-bridge.inc +6 -0
  129. package/runtime/ext_node/fs/parts/builtins.inc +69 -0
  130. package/runtime/ext_node/fs/parts/dir.inc +47 -0
  131. package/runtime/ext_node/fs/parts/encoding.inc +186 -0
  132. package/runtime/ext_node/fs/parts/errors.inc +66 -0
  133. package/runtime/ext_node/fs/parts/flags.inc +39 -0
  134. package/runtime/ext_node/fs/parts/platform.inc +86 -0
  135. package/runtime/ext_node/fs/parts/promisify.inc +15 -0
  136. package/runtime/ext_node/fs/parts/time.inc +9 -0
  137. package/runtime/rt.h +36 -4
  138. package/runtime/rt_internal.h +10 -23
  139. package/runtime/xt_builtins.c +4 -0
  140. package/runtime/xt_containers/access.inc +168 -0
  141. package/runtime/xt_containers/arrays.inc +108 -0
  142. package/runtime/xt_containers/boxes.inc +11 -0
  143. package/runtime/xt_containers/objects.inc +326 -0
  144. package/runtime/xt_containers.c +8 -618
  145. package/runtime/xt_ext.h +0 -1
  146. package/runtime/xt_io/base64.inc +87 -0
  147. package/runtime/xt_io/console.inc +119 -0
  148. package/runtime/xt_io/exception.inc +142 -0
  149. package/runtime/xt_io/inspect.inc +212 -0
  150. package/runtime/xt_io.c +11 -556
  151. package/runtime/xt_loop.c +262 -24
  152. package/runtime/xt_regex/api.inc +58 -0
  153. package/runtime/xt_regex/helpers.inc +68 -0
  154. package/runtime/xt_regex/matcher.inc +248 -0
  155. package/runtime/xt_regex/parser.inc +236 -0
  156. package/runtime/xt_regex/types.inc +58 -0
  157. package/runtime/xt_regex.h +9 -672
  158. package/runtime/xt_stdlib2/helpers.inc +2 -4
  159. package/runtime/xt_values/arithmetic.inc +150 -0
  160. package/runtime/xt_values/comparison.inc +112 -0
  161. package/runtime/xt_values/constructors.inc +41 -0
  162. package/runtime/xt_values/conversions.inc +115 -0
  163. package/runtime/xt_values/number-format.inc +180 -0
  164. package/runtime/xt_values/strings.inc +22 -0
  165. package/runtime/xt_values.c +10 -626
  166. package/scripts/build-gui.ts +317 -0
  167. package/scripts/build-runtime.ts +7 -8
  168. package/scripts/coverage-runtime.ts +4 -4
  169. package/scripts/package-release.ts +12 -84
  170. package/src/cli/main.ts +8 -4
  171. package/src/codegen/generator/state.ts +8 -0
  172. package/src/codegen/generator/tables.ts +13 -6
  173. package/src/driver/bundler/graph.ts +95 -0
  174. package/src/driver/bundler/merge.ts +312 -0
  175. package/src/driver/bundler/resolve.ts +240 -0
  176. package/src/driver/bundler/symbols.ts +55 -0
  177. package/src/driver/bundler/types.ts +37 -0
  178. package/src/driver/index.ts +1 -9
  179. package/src/driver/modules.ts +9 -693
  180. package/src/driver/paths.ts +0 -31
  181. package/src/driver/toolchain-provider.ts +12 -45
  182. package/src/driver/toolchain.ts +7 -2
  183. package/src/extensions/catalog.ts +2 -1
  184. package/src/extensions/gui/index.ts +107 -0
  185. package/src/extensions/native.ts +2 -3
  186. package/dist/src/driver/toolchain-download.d.ts +0 -50
  187. package/dist/src/driver/toolchain-download.js +0 -102
  188. package/dist/src/driver/toolchain-download.js.map +0 -1
  189. package/dist/tests/driver/toolchain-download.test.d.ts +0 -1
  190. package/dist/tests/driver/toolchain-download.test.js +0 -53
  191. package/dist/tests/driver/toolchain-download.test.js.map +0 -1
  192. package/dist/tests/e2e/compile.test.d.ts +0 -8
  193. package/dist/tests/e2e/compile.test.js +0 -893
  194. package/dist/tests/e2e/compile.test.js.map +0 -1
  195. package/dist/tests/e2e/differential.test.d.ts +0 -7
  196. package/dist/tests/e2e/differential.test.js.map +0 -1
  197. package/dist/tests/e2e/runtime-coverage.test.d.ts +0 -11
  198. package/dist/tests/e2e/runtime-coverage.test.js +0 -646
  199. package/dist/tests/e2e/runtime-coverage.test.js.map +0 -1
  200. package/scripts/fetch-toolchain.ts +0 -101
  201. package/src/driver/toolchain-download.ts +0 -135
@@ -1,208 +1,10 @@
1
1
  /**
2
- * Differential tests: compile a program with xbintsc, run it, and compare the
3
- * output byte-for-byte with the same program executed by Node. Every program
4
- * prints canonical `JSON.stringify` lines so console formatting never masks a
5
- * real semantic difference.
2
+ * Differential tests for control flow, classes, regexes, generators and function semantics.
6
3
  */
7
- import { it } from "vitest";
8
4
  import { describeE2E } from "./harness.js";
9
- describeE2E("differential vs Node", (harness) => {
10
- /** Register one differential case from a complete program source. */
11
- const diff = (name, source) => {
12
- it(name, () => {
13
- harness.expectSameOutputAsNode(source, { name: `diff_${name.replace(/\W+/g, "_")}` });
14
- });
15
- };
16
- const printAll = (values) => `const values: unknown[] = [\n${values.map((v) => ` ${v},`).join("\n")}\n];\n` +
17
- `for (const v of values) console.log(JSON.stringify(v));\n`;
18
- diff("number formatting and coercion", printAll([
19
- "0",
20
- "-0",
21
- "1.5",
22
- "0.1",
23
- "1 / 3",
24
- "1e21",
25
- "1e-7",
26
- "1e-6",
27
- "123456789012345680000",
28
- "Number.MAX_SAFE_INTEGER",
29
- "Number.MIN_SAFE_INTEGER",
30
- "Number.EPSILON",
31
- "Infinity",
32
- "-Infinity",
33
- "NaN",
34
- "(1234.5678).toFixed(2)",
35
- "(0.000001).toFixed(7)",
36
- "(1e21).toFixed(2)",
37
- "(2.5).toFixed(0)",
38
- "(-2.5).toFixed(0)",
39
- "(123.456).toPrecision(5)",
40
- "(123.4).toPrecision(10)",
41
- "(0.0001234).toPrecision(2)",
42
- "(12345).toExponential()",
43
- "(12345).toExponential(2)",
44
- "(0.000123).toExponential(3)",
45
- "(255).toString(16)",
46
- "(255).toString(2)",
47
- "String(42)",
48
- "String(1e21)",
49
- "String(1e-7)",
50
- ]));
51
- diff("number parsing and predicates", printAll([
52
- 'Number(" 42 ")',
53
- 'Number("")',
54
- 'Number("0x1f")',
55
- 'Number("0b101")',
56
- 'Number("0o17")',
57
- 'Number("abc")',
58
- 'parseInt("42px")',
59
- 'parseFloat("3.14abc")',
60
- "isNaN(NaN)",
61
- "isFinite(3)",
62
- "Number.isInteger(3)",
63
- "Number.isInteger(3.5)",
64
- "Number.isNaN(NaN)",
65
- "Number.isFinite(Infinity)",
66
- "Number.isSafeInteger(2 ** 53)",
67
- ]));
68
- diff("abstract equality and coercion", printAll([
69
- '1 == "1"',
70
- '1 === "1"',
71
- "0 == false",
72
- '"" == false',
73
- "null == undefined",
74
- "null === undefined",
75
- "[] == false",
76
- "[] == 0",
77
- "[1] == 1",
78
- '[1, 2] == "1,2"',
79
- '{} == "[object Object]"',
80
- "NaN == NaN",
81
- '"1" == true',
82
- '"0" == false',
83
- ]));
84
- diff("arithmetic and relational operators", printAll([
85
- "[] + []",
86
- "[1] + [2]",
87
- "[1, 2] + [3]",
88
- '{} + ""',
89
- '1 + "2"',
90
- '"3" - 1',
91
- '"3" * "2"',
92
- "true + 1",
93
- "null + 1",
94
- "undefined + 1",
95
- '+ "42"',
96
- '+ "0x1f"',
97
- '+ ""',
98
- '+ " 12 "',
99
- '+ "abc"',
100
- "[2] < 3",
101
- '[1, 2] < "1,3"',
102
- '"10" < "9"',
103
- "10 < 9",
104
- "2 ** 10",
105
- "7 % 3",
106
- "-7 % 3",
107
- "1 / 0",
108
- "0 / 0",
109
- ]));
110
- diff("logical operators, bitwise and typeof", printAll([
111
- '0 || "x"',
112
- '"" || "y"',
113
- 'null ?? "z"',
114
- 'undefined ?? "w"',
115
- "0 ?? 5",
116
- "5 & 3",
117
- "5 | 2",
118
- "5 ^ 1",
119
- "~5",
120
- "1 << 4",
121
- "-8 >> 1",
122
- "-8 >>> 1",
123
- "typeof 1",
124
- 'typeof "a"',
125
- "typeof true",
126
- "typeof undefined",
127
- "typeof null",
128
- "typeof {}",
129
- "typeof []",
130
- "typeof (() => 1)",
131
- ]));
132
- diff("string methods", printAll([
133
- '"Hello, World".length',
134
- '"Hello, World".toUpperCase()',
135
- '"Hello, World".toLowerCase()',
136
- '"Hello, World".indexOf("o")',
137
- '"Hello, World".lastIndexOf("o")',
138
- '"Hello, World".includes("World")',
139
- '"Hello, World".slice(7)',
140
- '"Hello, World".slice(-5)',
141
- '"Hello, World".substring(0, 5)',
142
- '"Hello, World".substr(7, 3)',
143
- '"a, b, c".split(", ")',
144
- '"Hello".replace("l", "L")',
145
- '"Hello".replaceAll("l", "L")',
146
- '"ab".repeat(3)',
147
- '"Hello".charAt(1)',
148
- '"Hello".charCodeAt(0)',
149
- '" pad ".trim()',
150
- '"ab".padStart(5, "-")',
151
- '"ab".padEnd(5, "-")',
152
- '"Hello".concat("!" )',
153
- '"a1b2c3".match(/\\d/g)',
154
- '"a1b2c3".replace(/\\d/g, "#")',
155
- '"abc".at(-1)',
156
- '"Hello".localeCompare("World")',
157
- ]));
158
- diff("array methods", printAll([
159
- "[3, 1, 2].sort()",
160
- '["banana", "apple", "cherry"].sort()',
161
- "[10, 9, 100].sort()",
162
- "[3, 1, 2].sort((a, b) => a - b)",
163
- "[1, 2, 3].map((x) => x * 2)",
164
- "[1, 2, 3, 4].filter((x) => x % 2 === 0)",
165
- "[1, 2, 3].reduce((a, b) => a + b, 0)",
166
- "[1, 2, 3].reverse()",
167
- '[1, 2, 3].join("-")',
168
- "[1, [2, [3, [4]]]].flat(2)",
169
- "[1, 2, 3].flatMap((x) => [x, x])",
170
- "[1, 2, 3, 4].slice(1, 3)",
171
- "[1, 2, 3].concat([4, 5])",
172
- "[1, 2, 3].indexOf(2)",
173
- "[1, 2, 3].includes(4)",
174
- "[5, 3, 8].find((x) => x > 4)",
175
- "[1, 2, 3].some((x) => x > 2)",
176
- "[1, 2, 3].every((x) => x > 0)",
177
- "Array.isArray([])",
178
- "Array.from([1, 2, 3], (x) => x + 1)",
179
- "Array.of(1, 2, 3)",
180
- "[1, 2, 3].fill(0, 1)",
181
- "[1, 2, 3, 4].copyWithin(0, 2)",
182
- "[1, 2, 3].at(-1)",
183
- "[1, 2, 3].splice(1, 1)",
184
- ]));
185
- diff("objects, key order and JSON", `const o = { b: 2, a: 1, "10": "ten", "2": "two", c: 3 };
186
- ${printAll([
187
- "Object.keys(o)",
188
- "Object.values(o)",
189
- "Object.entries(o)",
190
- "JSON.stringify(o)",
191
- "JSON.stringify({ x: undefined, y: null, z: () => 1 })",
192
- "JSON.stringify([undefined, null, () => 1])",
193
- "JSON.stringify({ a: { b: [1, 2, { c: 3 }] } })",
194
- 'JSON.stringify("hi")',
195
- "JSON.stringify(5)",
196
- "JSON.stringify(true)",
197
- "JSON.stringify(null)",
198
- "JSON.stringify(NaN)",
199
- "JSON.stringify(Infinity)",
200
- "JSON.stringify(undefined)",
201
- "Object.assign({}, o, { d: 4 })",
202
- "{ ...o, e: 5 }",
203
- '"a" in o',
204
- 'o.hasOwnProperty("a")',
205
- ])}`);
5
+ import { makeDifferential } from "./differential-helpers.js";
6
+ describeE2E("differential vs Node: language and built-ins", (harness) => {
7
+ const { diff, printAll } = makeDifferential(harness);
206
8
  diff("control flow, closures and classes", `function fib(n: number): number { return n < 2 ? n : fib(n - 1) + fib(n - 2); }
207
9
  function classify(x: number): string {
208
10
  if (x < 0) return "neg";
@@ -493,89 +295,5 @@ const obj = {
493
295
  };
494
296
  console.log(JSON.stringify([...obj.gen(), Math.max(...obj.gen())]));
495
297
  `);
496
- it("implements symbols and the well-known symbol protocol", () => {
497
- harness.expectSameOutputAsNode(`const a = Symbol("desc");
498
- const b = Symbol("desc");
499
- const lines: unknown[] = [
500
- typeof Symbol,
501
- typeof a,
502
- a === a,
503
- a === b,
504
- a.toString(),
505
- String(a),
506
- a.description,
507
- Symbol().description,
508
- String(Symbol()),
509
- String(Symbol.iterator),
510
- Symbol.iterator === Symbol.iterator,
511
- Symbol.for("k") === Symbol.for("k"),
512
- Symbol.keyFor(Symbol.for("k")),
513
- Symbol.keyFor(Symbol("k")),
514
- ];
515
- for (const line of lines) console.log(JSON.stringify(line));
516
-
517
- const holder: Record<string, unknown> = {};
518
- (holder as any)[a] = 1;
519
- (holder as any)[b] = 2;
520
- holder.x = 3;
521
- console.log(JSON.stringify(Object.keys(holder)));
522
- console.log(JSON.stringify(Object.getOwnPropertySymbols(holder).length));
523
- console.log(
524
- JSON.stringify([(holder as any)[a], (holder as any)[b], (holder as any)[Symbol("desc")]]),
525
- );
526
- console.log(JSON.stringify(holder));
527
- console.log(JSON.stringify(a));
528
- console.log(JSON.stringify([a, 1]));
529
-
530
- class Range {
531
- start: number;
532
- end: number;
533
- constructor(start: number, end: number) {
534
- this.start = start;
535
- this.end = end;
536
- }
537
- [Symbol.iterator]() {
538
- let i = this.start;
539
- const end = this.end;
540
- return {
541
- next() {
542
- return i < end ? { value: i++, done: false } : { value: undefined, done: true };
543
- },
544
- };
545
- }
546
- }
547
- console.log(JSON.stringify([...new Range(1, 4)]));
548
- const walked: number[] = [];
549
- for (const x of new Range(10, 13)) walked.push(x);
550
- console.log(JSON.stringify(walked));
551
-
552
- function* delegates() { yield* new Range(5, 7); }
553
- console.log(JSON.stringify([...delegates()]));
554
- `, { name: "diff_symbol" });
555
- });
556
- it("binds namespace imports to every export", () => {
557
- harness.expectSameOutputAsNode(`import * as util from "./util.ts";
558
- import { add } from "./util.ts";
559
- const values: unknown[] = [
560
- util.greeting,
561
- util.add(2, 3),
562
- add(20, 22),
563
- new util.default().value,
564
- Object.keys(util).sort(),
565
- typeof util.add,
566
- ];
567
- for (const v of values) console.log(JSON.stringify(v));
568
- `, {
569
- name: "diff_namespace_import",
570
- files: {
571
- "util.ts": [
572
- 'export const greeting = "hello";',
573
- "export function add(a: number, b: number): number { return a + b; }",
574
- "export default class Thing { value = 42; }",
575
- "export const ignored = 1;\n",
576
- ].join("\n"),
577
- },
578
- });
579
- });
580
298
  });
581
- //# sourceMappingURL=differential.test.js.map
299
+ //# sourceMappingURL=differential-language.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"differential-language.test.js","sourceRoot":"","sources":["../../../tests/e2e/differential-language.test.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Differential tests for symbols and namespace imports.
3
+ */
4
+ export {};
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Differential tests for symbols and namespace imports.
3
+ */
4
+ import { it } from "vitest";
5
+ import { describeE2E } from "./harness.js";
6
+ describeE2E("differential vs Node: symbols and bindings", (harness) => {
7
+ it("implements symbols and the well-known symbol protocol", () => {
8
+ harness.expectSameOutputAsNode(`const a = Symbol("desc");
9
+ const b = Symbol("desc");
10
+ const lines: unknown[] = [
11
+ typeof Symbol,
12
+ typeof a,
13
+ a === a,
14
+ a === b,
15
+ a.toString(),
16
+ String(a),
17
+ a.description,
18
+ Symbol().description,
19
+ String(Symbol()),
20
+ String(Symbol.iterator),
21
+ Symbol.iterator === Symbol.iterator,
22
+ Symbol.for("k") === Symbol.for("k"),
23
+ Symbol.keyFor(Symbol.for("k")),
24
+ Symbol.keyFor(Symbol("k")),
25
+ ];
26
+ for (const line of lines) console.log(JSON.stringify(line));
27
+
28
+ const holder: Record<string, unknown> = {};
29
+ (holder as any)[a] = 1;
30
+ (holder as any)[b] = 2;
31
+ holder.x = 3;
32
+ console.log(JSON.stringify(Object.keys(holder)));
33
+ console.log(JSON.stringify(Object.getOwnPropertySymbols(holder).length));
34
+ console.log(
35
+ JSON.stringify([(holder as any)[a], (holder as any)[b], (holder as any)[Symbol("desc")]]),
36
+ );
37
+ console.log(JSON.stringify(holder));
38
+ console.log(JSON.stringify(a));
39
+ console.log(JSON.stringify([a, 1]));
40
+
41
+ class Range {
42
+ start: number;
43
+ end: number;
44
+ constructor(start: number, end: number) {
45
+ this.start = start;
46
+ this.end = end;
47
+ }
48
+ [Symbol.iterator]() {
49
+ let i = this.start;
50
+ const end = this.end;
51
+ return {
52
+ next() {
53
+ return i < end ? { value: i++, done: false } : { value: undefined, done: true };
54
+ },
55
+ };
56
+ }
57
+ }
58
+ console.log(JSON.stringify([...new Range(1, 4)]));
59
+ const walked: number[] = [];
60
+ for (const x of new Range(10, 13)) walked.push(x);
61
+ console.log(JSON.stringify(walked));
62
+
63
+ function* delegates() { yield* new Range(5, 7); }
64
+ console.log(JSON.stringify([...delegates()]));
65
+ `, { name: "diff_symbol" });
66
+ });
67
+ it("binds namespace imports to every export", () => {
68
+ harness.expectSameOutputAsNode(`import * as util from "./util.ts";
69
+ import { add } from "./util.ts";
70
+ const values: unknown[] = [
71
+ util.greeting,
72
+ util.add(2, 3),
73
+ add(20, 22),
74
+ new util.default().value,
75
+ Object.keys(util).sort(),
76
+ typeof util.add,
77
+ ];
78
+ for (const v of values) console.log(JSON.stringify(v));
79
+ `, {
80
+ name: "diff_namespace_import",
81
+ files: {
82
+ "util.ts": [
83
+ 'export const greeting = "hello";',
84
+ "export function add(a: number, b: number): number { return a + b; }",
85
+ "export default class Thing { value = 42; }",
86
+ "export const ignored = 1;\n",
87
+ ].join("\n"),
88
+ },
89
+ });
90
+ });
91
+ });
92
+ //# sourceMappingURL=differential-symbols.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"differential-symbols.test.js","sourceRoot":"","sources":["../../../tests/e2e/differential-symbols.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,WAAW,CAAC,4CAA4C,EAAE,CAAC,OAAO,EAAE,EAAE;IACpE,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;QAC/D,OAAO,CAAC,sBAAsB,CAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDL,EACK,EAAE,IAAI,EAAE,aAAa,EAAE,CACxB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QACjD,OAAO,CAAC,sBAAsB,CAC5B;;;;;;;;;;;CAWL,EACK;YACE,IAAI,EAAE,uBAAuB;YAC7B,KAAK,EAAE;gBACL,SAAS,EAAE;oBACT,kCAAkC;oBAClC,qEAAqE;oBACrE,4CAA4C;oBAC5C,6BAA6B;iBAC9B,CAAC,IAAI,CAAC,IAAI,CAAC;aACb;SACF,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Differential tests for value coercion, formatting and the built-in value methods.
3
+ */
4
+ export {};
@@ -0,0 +1,197 @@
1
+ /**
2
+ * Differential tests for value coercion, formatting and the built-in value methods.
3
+ */
4
+ import { describeE2E } from "./harness.js";
5
+ import { makeDifferential } from "./differential-helpers.js";
6
+ describeE2E("differential vs Node: values", (harness) => {
7
+ const { diff, printAll } = makeDifferential(harness);
8
+ diff("number formatting and coercion", printAll([
9
+ "0",
10
+ "-0",
11
+ "1.5",
12
+ "0.1",
13
+ "1 / 3",
14
+ "1e21",
15
+ "1e-7",
16
+ "1e-6",
17
+ "123456789012345680000",
18
+ "Number.MAX_SAFE_INTEGER",
19
+ "Number.MIN_SAFE_INTEGER",
20
+ "Number.EPSILON",
21
+ "Infinity",
22
+ "-Infinity",
23
+ "NaN",
24
+ "(1234.5678).toFixed(2)",
25
+ "(0.000001).toFixed(7)",
26
+ "(1e21).toFixed(2)",
27
+ "(2.5).toFixed(0)",
28
+ "(-2.5).toFixed(0)",
29
+ "(123.456).toPrecision(5)",
30
+ "(123.4).toPrecision(10)",
31
+ "(0.0001234).toPrecision(2)",
32
+ "(12345).toExponential()",
33
+ "(12345).toExponential(2)",
34
+ "(0.000123).toExponential(3)",
35
+ "(255).toString(16)",
36
+ "(255).toString(2)",
37
+ "String(42)",
38
+ "String(1e21)",
39
+ "String(1e-7)",
40
+ ]));
41
+ diff("number parsing and predicates", printAll([
42
+ 'Number(" 42 ")',
43
+ 'Number("")',
44
+ 'Number("0x1f")',
45
+ 'Number("0b101")',
46
+ 'Number("0o17")',
47
+ 'Number("abc")',
48
+ 'parseInt("42px")',
49
+ 'parseFloat("3.14abc")',
50
+ "isNaN(NaN)",
51
+ "isFinite(3)",
52
+ "Number.isInteger(3)",
53
+ "Number.isInteger(3.5)",
54
+ "Number.isNaN(NaN)",
55
+ "Number.isFinite(Infinity)",
56
+ "Number.isSafeInteger(2 ** 53)",
57
+ ]));
58
+ diff("abstract equality and coercion", printAll([
59
+ '1 == "1"',
60
+ '1 === "1"',
61
+ "0 == false",
62
+ '"" == false',
63
+ "null == undefined",
64
+ "null === undefined",
65
+ "[] == false",
66
+ "[] == 0",
67
+ "[1] == 1",
68
+ '[1, 2] == "1,2"',
69
+ '{} == "[object Object]"',
70
+ "NaN == NaN",
71
+ '"1" == true',
72
+ '"0" == false',
73
+ ]));
74
+ diff("arithmetic and relational operators", printAll([
75
+ "[] + []",
76
+ "[1] + [2]",
77
+ "[1, 2] + [3]",
78
+ '{} + ""',
79
+ '1 + "2"',
80
+ '"3" - 1',
81
+ '"3" * "2"',
82
+ "true + 1",
83
+ "null + 1",
84
+ "undefined + 1",
85
+ '+ "42"',
86
+ '+ "0x1f"',
87
+ '+ ""',
88
+ '+ " 12 "',
89
+ '+ "abc"',
90
+ "[2] < 3",
91
+ '[1, 2] < "1,3"',
92
+ '"10" < "9"',
93
+ "10 < 9",
94
+ "2 ** 10",
95
+ "7 % 3",
96
+ "-7 % 3",
97
+ "1 / 0",
98
+ "0 / 0",
99
+ ]));
100
+ diff("logical operators, bitwise and typeof", printAll([
101
+ '0 || "x"',
102
+ '"" || "y"',
103
+ 'null ?? "z"',
104
+ 'undefined ?? "w"',
105
+ "0 ?? 5",
106
+ "5 & 3",
107
+ "5 | 2",
108
+ "5 ^ 1",
109
+ "~5",
110
+ "1 << 4",
111
+ "-8 >> 1",
112
+ "-8 >>> 1",
113
+ "typeof 1",
114
+ 'typeof "a"',
115
+ "typeof true",
116
+ "typeof undefined",
117
+ "typeof null",
118
+ "typeof {}",
119
+ "typeof []",
120
+ "typeof (() => 1)",
121
+ ]));
122
+ diff("string methods", printAll([
123
+ '"Hello, World".length',
124
+ '"Hello, World".toUpperCase()',
125
+ '"Hello, World".toLowerCase()',
126
+ '"Hello, World".indexOf("o")',
127
+ '"Hello, World".lastIndexOf("o")',
128
+ '"Hello, World".includes("World")',
129
+ '"Hello, World".slice(7)',
130
+ '"Hello, World".slice(-5)',
131
+ '"Hello, World".substring(0, 5)',
132
+ '"Hello, World".substr(7, 3)',
133
+ '"a, b, c".split(", ")',
134
+ '"Hello".replace("l", "L")',
135
+ '"Hello".replaceAll("l", "L")',
136
+ '"ab".repeat(3)',
137
+ '"Hello".charAt(1)',
138
+ '"Hello".charCodeAt(0)',
139
+ '" pad ".trim()',
140
+ '"ab".padStart(5, "-")',
141
+ '"ab".padEnd(5, "-")',
142
+ '"Hello".concat("!" )',
143
+ '"a1b2c3".match(/\\d/g)',
144
+ '"a1b2c3".replace(/\\d/g, "#")',
145
+ '"abc".at(-1)',
146
+ '"Hello".localeCompare("World")',
147
+ ]));
148
+ diff("array methods", printAll([
149
+ "[3, 1, 2].sort()",
150
+ '["banana", "apple", "cherry"].sort()',
151
+ "[10, 9, 100].sort()",
152
+ "[3, 1, 2].sort((a, b) => a - b)",
153
+ "[1, 2, 3].map((x) => x * 2)",
154
+ "[1, 2, 3, 4].filter((x) => x % 2 === 0)",
155
+ "[1, 2, 3].reduce((a, b) => a + b, 0)",
156
+ "[1, 2, 3].reverse()",
157
+ '[1, 2, 3].join("-")',
158
+ "[1, [2, [3, [4]]]].flat(2)",
159
+ "[1, 2, 3].flatMap((x) => [x, x])",
160
+ "[1, 2, 3, 4].slice(1, 3)",
161
+ "[1, 2, 3].concat([4, 5])",
162
+ "[1, 2, 3].indexOf(2)",
163
+ "[1, 2, 3].includes(4)",
164
+ "[5, 3, 8].find((x) => x > 4)",
165
+ "[1, 2, 3].some((x) => x > 2)",
166
+ "[1, 2, 3].every((x) => x > 0)",
167
+ "Array.isArray([])",
168
+ "Array.from([1, 2, 3], (x) => x + 1)",
169
+ "Array.of(1, 2, 3)",
170
+ "[1, 2, 3].fill(0, 1)",
171
+ "[1, 2, 3, 4].copyWithin(0, 2)",
172
+ "[1, 2, 3].at(-1)",
173
+ "[1, 2, 3].splice(1, 1)",
174
+ ]));
175
+ diff("objects, key order and JSON", `const o = { b: 2, a: 1, "10": "ten", "2": "two", c: 3 };
176
+ ${printAll([
177
+ "Object.keys(o)",
178
+ "Object.values(o)",
179
+ "Object.entries(o)",
180
+ "JSON.stringify(o)",
181
+ "JSON.stringify({ x: undefined, y: null, z: () => 1 })",
182
+ "JSON.stringify([undefined, null, () => 1])",
183
+ "JSON.stringify({ a: { b: [1, 2, { c: 3 }] } })",
184
+ 'JSON.stringify("hi")',
185
+ "JSON.stringify(5)",
186
+ "JSON.stringify(true)",
187
+ "JSON.stringify(null)",
188
+ "JSON.stringify(NaN)",
189
+ "JSON.stringify(Infinity)",
190
+ "JSON.stringify(undefined)",
191
+ "Object.assign({}, o, { d: 4 })",
192
+ "{ ...o, e: 5 }",
193
+ '"a" in o',
194
+ 'o.hasOwnProperty("a")',
195
+ ])}`);
196
+ });
197
+ //# sourceMappingURL=differential-values.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"differential-values.test.js","sourceRoot":"","sources":["../../../tests/e2e/differential-values.test.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * End-to-end tests for the `gui` extension.
3
+ *
4
+ * The suite compiles TypeScript programs that import `gui`, links them against
5
+ * the prebuilt `runtime/lib/<os>-<arch>/gui.a` and runs them. Programs close
6
+ * themselves through the `XT_GUI_AUTOCLOSE_MS` hook, so the tests never block on
7
+ * a real window.
8
+ *
9
+ * It is skipped when the GUI archive has not been built (run `npm run gui`
10
+ * first) and on Windows, where the archive is not produced yet.
11
+ */
12
+ export {};