Commit Graph
2402 Commits
Author SHA1 Message Date
Chris Tate d8f707a35e Drop the util.types.isFloat16Array entry main already adds 2026-10-18 01:35:31 -05:00
Chris Tate 6cdff93888 Merge main 2026-10-18 01:24:45 -05:00
Chris Tate d60978acb2 Match Node 24 in util.format, util.types and util.inspect (#1229) 2026-10-18 01:16:04 -05:00
Chris Tate 54ab14d604 Keep declared methods of generic class instances after a computed-key write (#1215) 2026-10-18 01:00:16 -05:00
Chris Tate dc1cb7c1d9 Merge main 2026-10-18 00:53:58 -05:00
Chris Tate b06e06f871 Merge main 2026-10-18 00:53:19 -05:00
Chris Tate 8077a9bfff Add DisposableStack (#1248) 2026-10-18 00:50:48 -05:00
Chris Tate 3f84d6475d Merge main 2026-10-18 00:50:24 -05:00
Chris Tate b15226075e Settle async generator completions on Node's microtask turns (#1251) 2026-10-18 00:48:44 -05:00
Chris Tate 7804e62041 Merge main 2026-10-18 00:39:44 -05:00
Chris Tate 421e98f5a9 Merge main 2026-10-18 00:31:04 -05:00
Chris Tate b64ef0a8bf Read fields of a class instance asserted to a wider union (#1254) 2026-10-18 00:29:05 -05:00
Chris Tate 6774fe5f08 Merge main 2026-10-18 00:28:33 -05:00
Chris Tate 86f5bc34bc Merge main 2026-10-18 00:26:05 -05:00
Chris Tate 5eb65cf64e Merge main 2026-10-18 00:24:03 -05:00
Chris Tate bce093c9fd Keep JavaScript lets open when a later object literal adds properties (#1252) 2026-10-18 00:19:23 -05:00
Chris Tate 6f9acfd5f8 Read fields of a class instance asserted to a wider union
A class instance that a type assertion widens to a union, such as
(concrete as A | B).value, still lowers as that class's instance. The
shared-property lowering now reads the field or calls the getter on the
known class instead of refusing the receiver for not being a tagged
union.

Closes #49
Co-authored-by: Patrick Wozniak <4481570+patlux@users.noreply.github.com>
2026-10-18 00:08:20 -05:00
Chris Tate ca23c11d10 Add the cstring class to library profiles (#1253) 2026-10-18 00:04:01 -05:00
Chris Tate 298e67443d Match Node 24 in URLSearchParams, querystring, string_decoder and os (#1228) 2026-10-18 00:01:40 -05:00
Chris Tate 87abacc400 Merge main 2026-10-18 00:01:05 -05:00
Chris Tate b6cfe07320 Merge main 2026-10-17 23:57:47 -05:00
Chris Tate 044b7ae42c Regenerate the surface manifest 2026-10-17 23:42:51 -05:00
Chris Tate 370bf5962d Add the cstring class to library profiles
Library exports and callbacks passed text only as a pointer and length.
profile_format 2 adds the cstring class, a NUL-terminated `const char *`
(an i32 pointer in Wasm reactors), for export parameters, export results
and callback parameters. Parameters are copied in and decoded as UTF-8,
with U+FFFD for malformed bytes; a NULL pointer is the SC4012
host-contract trap. Results live in the result arena like string
results. A result or callback argument containing U+0000 traps instead
of being truncated.

Closes #615
Co-authored-by: ailuoku6 <23209876+ailuoku6@users.noreply.github.com>
2026-10-17 23:40:06 -05:00
Chris Tate db18d45dd4 Merge main 2026-10-17 23:39:11 -05:00
Chris Tate b072969f3b Name the rejected value in the Object prototype TypeError (#1250) 2026-10-17 23:37:12 -05:00
Chris Tate 62bf38524d Merge main 2026-10-17 23:34:58 -05:00
Chris Tate ccd65e22c2 Merge main 2026-10-17 23:31:28 -05:00
Chris Tate 23ce40cace Keep JavaScript lets open when a later object literal adds properties
An untyped JavaScript `let` initialized with an object literal took the
initializer's record shape. A later assignment of an object literal with
more properties (`state = { _tag: "PullLeft", right }`, as in Effect's
Stream.zip) stored the object, but reading the added property failed with
SC1090. Such a binding now uses checked-dynamic storage, as it already does
when the program adds a property through the binding, so the added
properties read back and missing ones read as undefined, as in Node.

Closes #937
Co-authored-by: phall <25888173+phall1@users.noreply.github.com>
2026-10-17 23:25:06 -05:00
Chris Tate 97f2875f3f Merge main 2026-10-17 23:21:38 -05:00
Chris Tate aa19f948c5 Settle async generator completions on Node's microtask turns
An async generator that fell off its end, with a return type other than
void, settled its last next() one microtask turn after Node, so for await
loops over it also ended a turn late. The appended implicit return now
marks the completion as settled, like a bare `return;`.

return() at a suspended yield ran the generator's finally blocks before
awaiting the return value. The request now awaits the value first and
resumes the body on the next turn, and the completion that follows settles
without a further turn, also when a finally block yields or awaits first.
An explicit `return x` reached during that unwind still takes its own turn
to await x.

Array.fromAsync accepts typed async generator sources: each next() result
is awaited and its value used as is, a throwing or rejecting mapping
function closes the generator, and a rejected next() rejects the result on
the turn Node rejects it.
2026-10-17 23:19:15 -05:00
Chris Tate 982316d9e6 Merge main 2026-10-17 23:18:09 -05:00
Chris Tate f5c87fb191 Merge main 2026-10-17 23:15:19 -05:00
Chris Tate 9c900862c3 Add corpus costs for recently added programs (#1242) 2026-10-17 22:56:28 -05:00
Chris Tate ed817c017d Name the rejected value in the Object prototype TypeError
Object.setPrototypeOf and Object.create threw "Object prototype may only be
an Object or null" without the value Node appends. The message now ends
with the value's string form, as in Node: "...: 7", "...: undefined",
"...: Symbol(tag)".

A prototype or receiver that is a valid object of a kind these functions
do not handle yet (a function or Map prototype for Object.create, a Map
prototype or receiver for Object.setPrototypeOf) threw the same TypeError.
It now throws an Error that says the operation is not supported for that
value.
2026-10-17 22:50:45 -05:00
Chris Tate 2f93c46d2a Merge main 2026-10-17 22:49:18 -05:00
Chris Tate 33cab6f591 Prove generic classes acyclic like other classes (#1246) 2026-10-17 22:48:29 -05:00
Chris Tate 32061e8ba3 Add Float16Array
Float16Array is a native typed-array kind with IEEE 754 binary16 storage.
Stores round the number to nearest-even in one step from the double, as
Node does, including overflow to Infinity, subnormals, -0 and NaN; reads
widen exactly. The runtime converts with integer operations, so no target
needs half-precision hardware or compiler-rt support.

Construction, element reads and writes, ArrayBuffer views, fill, set,
subarray, slice, both sort orders, constructor values and checked-dynamic
storage work as for the other typed arrays. Math.f16round,
DataView.prototype.getFloat16 and setFloat16, and util.types.isFloat16Array
compile.
2026-10-17 22:45:32 -05:00
Chris Tate 43d9b02e8e Merge main 2026-10-17 22:45:12 -05:00
Chris Tate eeffa294e5 Merge main 2026-10-17 22:42:10 -05:00
Chris Tate 82c699b437 Add DisposableStack
new DisposableStack() compiles to a native stack handle. use, adopt, defer,
move, dispose, disposed and [Symbol.dispose] are members of its dynamic
view, and the stack works with `using`. Disposal runs the resources in
reverse order, calls use() resources' dispose methods with the resource as
`this`, and raises a SuppressedError chain when more than one disposal
throws; a single failure is rethrown as thrown. Calls on a disposed stack
throw Node's ReferenceError, and invalid receivers, resources and
callbacks throw Node's TypeErrors.

use() of a class instance registers a function that calls the class's
[Symbol.dispose] method, and returns the instance at its static type; use()
of a union that includes class instances is refused. The stack is
collected with its callbacks when a callback captures the stack.
x instanceof DisposableStack compiles. Handles can expose symbol-keyed
members through a new symbol_get hook.
2026-10-17 22:40:13 -05:00
Chris Tate 4fb38f0765 Merge main 2026-10-17 22:35:49 -05:00
Chris Tate e0998f0172 Prove generic classes acyclic like other classes
Each instantiation of a generic class names the generic class as its base,
and the generic class has no constructor function. The cycle analysis
treated a base without a constructor function as one whose constructor let
`this` escape, so every store in an instantiation's constructor counted as
a write after construction. A generic class could not be declared Acyclic,
and its constructor-only references were never treated as immutable.

A program class without a constructor function runs no code at
construction, so it now lets nothing escape. Runtime classes keep the
conservative answer.
2026-10-17 22:25:55 -05:00
Chris Tate 0d300f22eb Shift the runtime in bench:runtime layouts (#1245) 2026-10-17 21:56:05 -05:00
Chris Tate 84b74c0269 Keep declared methods of function-local classes after a computed-key write
observedPrototypeMethod skipped classPrototypeData for function-local
classes, which also marks such a class as needing prototype data, so its
instances got no prototype behind their property bag. A function-local
class value's prototype holds only methods the program replaced there, so
reads of a marked method name on its instances now check for the
property, own or inherited, and otherwise use the declared method, as for
generic class instances. The prototype data is built again, so a method
replaced on the class's prototype stays visible.
2026-10-17 21:50:39 -05:00
Chris Tate de4e10d542 Shift the runtime in bench:runtime layouts
The --layouts padding object was linked directly before the program
object. The runtime is linked before the program object, so every layout
moved only the program's code and left each runtime function at the same
address. A change to the runtime's code size then moved its functions in
all layouts at once, and the verdicts could not tell that placement
change from a real one.

The padding object now goes before every other input on the link line,
so each layout shifts the runtime and the program code.
2026-10-17 21:34:52 -05:00
Chris Tate f1f7302179 Monomorphize destructured options parameters of package functions (#1243) 2026-10-17 21:13:38 -05:00
Chris Tate e72ee037ca Give socket 'data' listeners strings after setEncoding (#1239) 2026-10-17 21:04:33 -05:00
Chris Tate aad9b4f140 Merge main 2026-10-17 21:01:15 -05:00
Chris Tate 8d8b96fefa Merge main 2026-10-17 20:59:05 -05:00
Chris Tate f291f1c275 Monomorphize destructured options parameters of package functions
A package function that destructures its options object, such as
makeClass({ Base, name }), now specializes per call site like positional
parameters: each destructured name binds the static type of the matching
property, so a class passed as { Base } keeps its static type and
class extends Base builds a constructible subclass.

Fixes #938
Co-authored-by: phall <25888173+phall1@users.noreply.github.com>
2026-10-17 20:50:59 -05:00