mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-02 07:43:42 +08:00
Merge remote-tracking branch 'origin/ni/i2-handles' into HEAD
This commit is contained in:
@@ -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
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user