Skip to content

v0.3.9

Choose a tag to compare

@github-actions github-actions released this 26 Nov 13:08
· 69 commits to main since this release
e997a09

0.3.9

A fifth independent review, of 0.3.8, found two behaviours to fix and several sentences that promised more than the code does (#372). No API change.

Fixed: a failed fill() (#373)

  • An Error made in another JavaScript realm (vm.runInNewContext, an iframe) is treated as an error: it is rewritten in place when it can be (a frozen one is replaced by a scrubbed copy, a new native error with the same prototype) and what comes back is a native error. 0.3.8 copied it like a plain object. A Date from another realm and a SharedArrayBuffer are returned as they are; 0.3.8 copied them, and the copied buffer's byteLength threw.
  • The short-value rule counts code points, not UTF-16 units: fill("🙂🙂") on a🙂🙂b leaves the text alone, where 0.3.8 removed the value between two letters. The number in <redacted, N chars> is in code points too.
  • A boxed number or bigint is read as the value it holds; 0.3.8 skipped it. Map and Set contents are read and written through the built-in methods, so a subclass that overrides set, entries or its iterator is not run.

What the redaction is

A best-effort scrub of ordinary error shapes, pinned by the cases in test/redact-value.test.ts. It is not a guarantee about every JavaScript object. The doc comment of redactValue lists what comes back, what is read and what is not; in short:

  • Read: strings; numbers and bigints whose digits contain the value; own properties (string- and symbol-keyed, enumerable or not); array elements; Map and Set entries.
  • Not read: property names; symbols and functions; private fields; the own properties of a boxed string, number or bigint; what only a prototype accessor or a method computes (the text of a URL, Headers or Request); ArrayBuffer, SharedArrayBuffer and their views, Date, RegExp, Promise, WeakMap, WeakSet.
  • The redaction reads an own property at most once per call. The engine may call an error's name and message accessors again itself when stack is first read.
  • A value of fewer than four code points is removed only as a whole token, so a short value next to a letter or digit stays readable.

Comments corrected, code unchanged

  • The orphan reap compares the pid with the recorded start time right before SIGKILL. The comparison and the signal are two steps; a pid that changes hands between them is not protected.

Docs checks (test-only)

The checker reads ** and % in a written delay, looks through a parenthesised optional call, treats a bracket string with a dot as one property, does not flag Atomics.wait with a zero timeout, accepts any identifier in // given:, takes ECMAScript's globals from a fresh realm, and resolves a page function passed by name only when it is declared once. Its comments list what each check leaves out. All 51 examples in the 17 shipped documents pass.

Tests

Five new or extended tests fail before their fix: another realm, code points, boxed number with an overriding Map subclass, and the two docs-check tables.

Known, filed

  • #356: the raw-TLS source scan exceeded its 5 s default in 3 of 5 full runs on a 14-core box at load 36-59 today (5.1, 5.5 and 10.3 s) and passed on idle runners. Cause not established. #364: one slow Windows run of a SQLite test.

Verification

Hosted CI: Linux (bun and Node), macOS and Windows pass at the merged head. Full bun suite on a Linux build box at load 36: 755 pass, 16 skip, 0 fail.

What's Changed

  • fix: errors and built-ins of another realm, a code-point short-value rule, and comments that say what the code does by @code-yeongyu in #373
  • chore(release): 0.3.9 by @code-yeongyu in #374

Full Changelog: v0.3.8...v0.3.9