Skip to content

Commit

Permalink
fix: add missing exports
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Dec 2, 2024
1 parent 4ddda99 commit 1e98a3a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/runtime/node/module/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ export const findSourceMap: typeof nodeModule.findSourceMap = function (
return undefined;
};

export const flushCompileCache: typeof nodeModule.flushCompileCache =
function flushCompileCache() {
/* silent noop */
};

export const wrap: typeof nodeModule.wrap = function (source) {
return `(function (exports, require, module, __filename, __dirname) { ${source}\n});`;
};
Expand Down Expand Up @@ -160,6 +165,7 @@ export const Module = {
runMain,
syncBuiltinESMExports,
wrap,
flushCompileCache,
} satisfies Omit<typeof nodeModule.Module, "Module" | "prototype"> &
Record<string, any>;

Expand Down
6 changes: 6 additions & 0 deletions src/runtime/node/worker_threads/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ export const markAsUntransferable: typeof worker_threads.markAsUntransferable =
// noop
};

export const markAsUncloneable: typeof worker_threads.markAsUncloneable =
() => {
// noop
};

export const moveMessagePortToContext: typeof worker_threads.moveMessagePortToContext =
() => new MessagePort();

Expand Down Expand Up @@ -56,6 +61,7 @@ export default <typeof worker_threads>{
isMainThread,
isMarkedAsUntransferable,
markAsUntransferable,
markAsUncloneable,
moveMessagePortToContext,
parentPort,
receiveMessageOnPort,
Expand Down
1 change: 1 addition & 0 deletions src/runtime/web/performance/_entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export class _PerformanceResourceTiming
startTime: number = 0;
transferSize: number = 0;
workerStart: number = 0;
responseStatus: number = 0;
}

export const PerformanceResourceTiming: typeof globalThis.PerformanceResourceTiming =
Expand Down

0 comments on commit 1e98a3a

Please sign in to comment.