Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,5 @@
- Add experimental Node worker resource limits with per-VM managed-heap termination, nursery and stack sizing, and effective-limit reporting using the pinned OpenClaw WebKit. Code-range limits remain reporting-only. Adapts [oven-sh/bun#32896](https://github.com/oven-sh/bun/pull/32896). Thanks @robobun!

- Preserve importing AsyncLocalStorage contexts across module-loader hooks, static and dynamic dependencies, top-level await, shared imports, and errors with the pinned OpenClaw WebKit; add Node-comparable loader regressions. Related to [oven-sh/bun#37933](https://github.com/oven-sh/bun/pull/37933). Thanks @robobun!

- Fix Intl.Segments.containing() at both halves of surrogate pairs with the pinned OpenClaw WebKit; cover grapheme, word, and sentence boundaries in both lookup directions. Ports [oven-sh/WebKit#753](https://github.com/oven-sh/WebKit/pull/753). Thanks @robobun!
2 changes: 2 additions & 0 deletions docs/runtime/nodejs-compat.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ The OpenClaw fork reports missing runtime imports without downloading npm packag

`CallSite.getLineNumber()` and `getColumnNumber()` return one-based positions, or `null` when a frame has no source position. Stack strings include column 1 and use the same constructor positions as CallSites, pointing to the `new` keyword, including across line breaks and in `node:vm` scripts. Some expression positions still differ from Node.js because JavaScriptCore and Bun's transpiler select different syntax locations.

`Intl.Segments.containing()` respects surrogate-pair boundaries for grapheme, word, and sentence segmentation with the pinned OpenClaw WebKit.

### [`node:assert`](https://nodejs.org/api/assert.html)

🟢 Fully implemented. Legacy-mode `deepEqual` uses `Bun.deepEquals` semantics rather than Node's loose `==` comparison, and function-valued or `printf`-style `message` arguments are not formatted.
Expand Down
25 changes: 25 additions & 0 deletions test/js/web/intl/intl.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,31 @@ describe.skipIf(isWindows).concurrent("locale variables in the environment", ()
// ---------------------------------------------------------------------------

describe("Intl.Segmenter", () => {
test.each(["grapheme", "word", "sentence"] as const)(
"containing agrees with iteration at surrogate boundaries: %s",
granularity => {
const inputs = ["a😀b", "Hello, world! 👍🏽 x", "a🇯🇵b", "a👨‍👩‍👧‍👦b", "Hi. 👍 Bye.", "👍🏽", "x\ud83d", "abc"];
for (const input of inputs) {
const segments = new Intl.Segmenter("en", { granularity }).segment(input);
const expected = Array.from(segments);
for (const direction of [1, -1]) {
for (
let index = direction > 0 ? 0 : input.length - 1;
index >= 0 && index < input.length;
index += direction
) {
const result = expected.find(
segment => segment.index <= index && index < segment.index + segment.segment.length,
);
expect(segments.containing(index)).toEqual(result);
}
}
expect(segments.containing(-1)).toBeUndefined();
expect(segments.containing(input.length)).toBeUndefined();
}
},
);

const seg = (loc: string, g: Intl.SegmenterOptions["granularity"], s: string) =>
[...new Intl.Segmenter(loc, { granularity: g }).segment(s)].map(x => x.segment);

Expand Down
Loading