summaryrefslogtreecommitdiff
path: root/ext/node/analyze.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-05-16 05:16:24 +0200
committerGitHub <noreply@github.com>2023-05-16 05:16:24 +0200
commit78fbc3f3f695610083d07a55ef2a116e0bf04a10 (patch)
tree8c09614e023aa9f46a16b591dced4446f484b9eb /ext/node/analyze.rs
parentab9a17eeee01a3b04fac2bf583c812179f410c91 (diff)
fix(npm): add performance.markResourceTiming sham (#19123)
This commit shams "performance.markResourceTiming" API by using a noop function. It is done to provide compatibility with "npm:undici" package. We should look into actually implementing this API properly, but I wanted to unblock support for "undici" and "astro" for now. Ref https://github.com/denoland/deno/issues/19065
Diffstat (limited to 'ext/node/analyze.rs')
-rw-r--r--ext/node/analyze.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/node/analyze.rs b/ext/node/analyze.rs
index 6d32c68be..2e5c2d15f 100644
--- a/ext/node/analyze.rs
+++ b/ext/node/analyze.rs
@@ -32,6 +32,7 @@ static NODE_GLOBALS: &[&str] = &[
"setImmediate",
"setInterval",
"setTimeout",
+ "performance",
];
#[derive(Debug, Clone)]
@@ -528,7 +529,7 @@ mod tests {
"var clearTimeout = globalThis.clearTimeout;var console = globalThis.console;",
"var global = globalThis.global;var process = globalThis.process;",
"var setImmediate = globalThis.setImmediate;var setInterval = globalThis.setInterval;",
- "var setTimeout = globalThis.setTimeout;\n",
+ "var setTimeout = globalThis.setTimeout;var performance = globalThis.performance;\n",
"export const x = 1;"
),
NODE_GLOBAL_THIS_NAME,