Commit graph

57 commits

Author SHA1 Message Date
Sebastian Herrlinger
7927b7fc9b Merge remote-tracking branch 'origin/dev' into codemode-rust
# Conflicts:
#	packages/codemode/src/language/vm.ts
#	packages/codemode/test/test262/skipped.txt
2026-11-19 22:11:20 +01:00
James Long
ca729da9a5
fix(codemode): pass the in-scope test262 class tests (#64965) 2026-11-19 19:21:12 +00:00
Sebastian Herrlinger
4023cfa913 Merge remote-tracking branch 'origin/dev' into codemode-rust
# Conflicts:
#	packages/codemode/src/language/generators.ts
#	packages/codemode/src/language/internal-prelude.ts
#	packages/codemode/src/language/prelude/bytecode.json
#	packages/codemode/src/language/runtime/errors.ts
#	packages/codemode/src/language/vm.ts
#	packages/codemode/test/test262/skipped.txt
2026-11-19 19:01:08 +01:00
James Long
d3f6559d93
feat(codemode): getters and setters (#64908) 2026-11-19 17:12:53 +00:00
kommander
3dbee2a738 fix(codemode): convert Array arguments, lengths and sort elements through ToPrimitive
The integer arguments of the Array methods, length = object, and the elements a default sort compares call the program's own valueOf/toString, as do String.fromCharCode/fromCodePoint, JSON.parse, and the string iterator's receiver. repeat(NaN) is "", as ToIntegerOrInfinity makes NaN 0.
2026-11-18 18:56:08 +01:00
kommander
d4bb17439f fix(codemode): delete on a primitive base is true unless the wrapper owns the key
delete "abc"[5] and delete (1).x are true, as they delete from the wrapper; a string's own index or length still throws in strict mode.
2026-11-18 18:56:01 +01:00
kommander
e70845f198 fix(codemode): evaluate the right side of o.x = v before checking o
PutValue checks the base, so null.x = f() calls f before it throws, and (1).x = f() surfaces f's throw.
2026-11-18 18:55:49 +01:00
kommander
2a932f1331 fix(codemode): convert functions, generators and iterators through ToPrimitive
Operators and built-in arguments now call their valueOf/toString like any other object, as JS does: fn + 1 is "[object Function]1" and -fn is NaN. Promises and tool references still reject, so a missing await cannot hide.
2026-11-18 18:55:16 +01:00
James Long
a73657f3f9
refactor(codemode): flatten the VM into src and remove two-engine leftovers (#63377) 2026-11-12 13:39:15 -05:00
James Long
ffde0f7d47
feat(codemode): add a bytecode VM engine behind CodeMode.make({ engine: "vm" }) (#62357) 2026-11-06 11:37:45 -06:00
Aiden Cline
ecc075a043
fix(codemode): visit inherited enumerable keys in for...in (#59933) 2026-10-28 23:44:28 -05:00
Aiden Cline
711802c3a3
fix(codemode): let search be awaited or chained like a Promise (#59981) 2026-10-28 15:31:19 -05:00
Aiden Cline
5335347e80
feat(codemode): add WeakMap and WeakSet (#51257) 2026-09-25 00:15:19 -05:00
Aiden Cline
962c14a49c
fix(codemode): honor thisArg, program toString in computed keys, and ToPrimitive in String and Number arguments (#51264) 2026-09-24 23:46:15 -05:00
Aiden Cline
e23d89c9a9
fix(codemode): destructure object patterns from primitives and convert Date components through ToPrimitive (#51239) 2026-09-24 19:32:19 -05:00
Aiden Cline
5256f30957
feat(codemode): honor program valueOf and toString in operators and conversions (#50837) 2026-09-24 18:45:48 -05:00
Aiden Cline
56262121ee
feat(codemode): bind this and arguments in functions, add Function.prototype.call, apply, and bind (#50831) 2026-09-24 16:34:46 -05:00
Aiden Cline
a16eedfed7
fix(codemode): make derived error constructors inherit from Error (#51045) 2026-09-24 14:03:10 -05:00
Aiden Cline
318a8c1aba
feat(codemode): add Object.freeze/seal/create/getPrototypeOf and structuredClone (#50834) 2026-09-24 00:50:54 -05:00
Aiden Cline
dc48655743
fix(codemode): compare with == by IsLooselyEqual and stop deep-walking operands for opaque references (#50830) 2026-09-24 00:36:41 -05:00
Aiden Cline
68b28bdb98
fix(codemode): coerce match/search patterns, allow any for...in target, bind the last duplicate parameter (#50802) 2026-09-22 23:32:27 -05:00
Aiden Cline
17abc5906b
feat(codemode): add tagged templates and String.raw (#50791) 2026-09-22 21:25:21 -05:00
Aiden Cline
9fdcb8da41
fix(codemode): coerce built-in arguments as in JS instead of requiring numbers and strings (#50492) 2026-09-21 23:04:04 -05:00
Aiden Cline
651529d64e
fix(codemode): coerce any value to a property key (#50479) 2026-09-21 21:35:20 -05:00
Aiden Cline
02566f6219
fix(codemode): live Map/Set forEach, generator prototypes, repeated function declarations, delete on non-references (#50450) 2026-09-21 18:09:45 -05:00
Aiden Cline
cbdd1f66da
fix(codemode): locate failures in the submitted source (#50197) 2026-09-20 20:47:54 -05:00
Aiden Cline
eb0e26b974
feat(codemode): return live iterators from keys, values, and entries (#50061) 2026-09-19 18:46:35 -05:00
Aiden Cline
d797722187
feat(codemode): carry cause and own data across the error boundary (#49390) 2026-09-16 15:58:05 -05:00
Aiden Cline
0b15abbf9a
refactor(codemode): make the host boundary JSON.stringify plus a short table (#49128) 2026-09-15 01:23:20 -05:00
Aiden Cline
6add96698e
refactor(codemode): move built-ins onto real prototypes with native function objects (#48608) 2026-09-12 02:19:30 -05:00
Aiden Cline
b2e6e764a8
refactor(codemode): give errors a real prototype chain and JS error types (#48559) 2026-09-11 21:45:29 -05:00
Aiden Cline
68b862da49
refactor(codemode): make functions program objects with name and length (#48541) 2026-09-11 14:50:07 -05:00
Aiden Cline
10ae321bf3
refactor(codemode): give programs their own objects and arrays (#48527) 2026-09-11 13:36:35 -05:00
Aiden Cline
1452aadc87
feat(codemode): add substr, well-formed, and Date string methods (#48275) 2026-09-09 23:29:34 -05:00
Aiden Cline
5ec7dd968c
fix(codemode): coerce enumeration sources like JS ToObject (#48257) 2026-09-09 22:24:55 -05:00
Aiden Cline
50ed7c41ef
refactor(codemode): treat prototype-named keys as ordinary data (#48218) 2026-09-09 16:54:55 -05:00
Aiden Cline
08e28fb915
refactor(codemode): name the data boundary and prepare tools once (#48021) 2026-09-08 21:35:36 -05:00
Aiden Cline
6f4b9504e5
feat(codemode): support custom async iterators (#38141) 2026-07-21 12:18:46 -05:00
Aiden Cline
065b108bba
feat(codemode): support JSON callbacks (#38006) 2026-07-20 22:25:14 -05:00
Aiden Cline
0c18d06c9f
feat(codemode): add groupBy parity (#37992) 2026-07-20 14:58:09 -05:00
Aiden Cline
6d50023457
feat(codemode): complete regexp and math parity (#37955) 2026-07-20 11:29:55 -05:00
Aiden Cline
3da0dea8e7
feat(codemode): expand standard library parity (#37943) 2026-07-20 09:59:37 -05:00
Aiden Cline
deee40c572
fix(codemode): parse canonical index keys (#37851) 2026-07-19 23:55:53 -05:00
Aiden Cline
33f1b269e9
fix(codemode): stop leaking undefined into tool arguments (#37652) 2026-07-18 13:42:16 -05:00
Aiden Cline
5f437a09b0
feat(codemode): native coercion parity in interpreter (#37608) 2026-07-18 12:01:10 -05:00
Aiden Cline
91238441a6
fix(codemode): enforce lexical temporal dead zones (#37358) 2026-07-16 22:26:45 -05:00
Aiden Cline
c764732aea
feat(codemode): expand destructuring support (#37342) 2026-07-16 12:57:37 -05:00
Aiden Cline
ad8e6b1fb6
feat(codemode): support property deletion (#37335) 2026-07-16 12:21:28 -05:00
Aiden Cline
60c7f847c1
feat(codemode): support void and Object.is (#37332) 2026-07-16 11:15:29 -05:00
Aiden Cline
ecb5754f4c
refactor(codemode): rename Sandbox terminology to CodeMode (#36768) 2026-07-13 16:38:11 -05:00