Merge remote-tracking branch 'origin/ni/i2-handles' into HEAD

This commit is contained in:
Malte Ubl
2026-10-26 16:36:30 -07:00
2 changed files with 7 additions and 2 deletions
@@ -1168,6 +1168,10 @@ export function lowerToIr(
function markModuleInitFences(program: ts.Program, fences: readonly ScrDiagnostic[]): void {
for (const d of fences) {
if (!d.loc.file.includes("/node_modules/")) continue;
// A fence without a source position belongs to synthesized code, such
// as the global object's lookup (global-values.ts), which runs when the
// program calls it, not when the module evaluates.
if (d.loc.start < 0) continue;
const sf = program.getSourceFile(d.loc.file);
if (sf === undefined) continue;
let inFunction = false;
+3 -2
View File
@@ -1,5 +1,6 @@
"use strict";
// Loads its part through a computed specifier, so it runs in a Node island.
// Loads its part through a computed specifier when it loads, so it runs in
// a Node island.
const { createRequire } = require("node:module");
const parts = ["./thing"].map((p) => createRequire(__filename)(p));
const parts = [createRequire(__filename)(["./thing"][0])];
exports.make = () => new parts[0].Thing();