mirror of
https://github.com/denoland/deno.git
synced 2024-11-28 16:20:57 -05:00
fix(ext/node): add stubs for perf_hooks.PerformaceObserver (#23958)
Fixes https://github.com/denoland/deno/issues/23943
This commit is contained in:
parent
fa1ba256d2
commit
aeafb7b39e
2 changed files with 12 additions and 4 deletions
|
@ -9,8 +9,15 @@ import {
|
|||
PerformanceEntry,
|
||||
} from "ext:deno_web/15_performance.js";
|
||||
|
||||
// FIXME(bartlomieju)
|
||||
const PerformanceObserver = undefined;
|
||||
class PerformanceObserver {
|
||||
observe() {
|
||||
notImplemented("PerformanceObserver.observe");
|
||||
}
|
||||
disconnect() {
|
||||
notImplemented("PerformanceObserver.disconnect");
|
||||
}
|
||||
}
|
||||
|
||||
const constants = {};
|
||||
|
||||
const performance:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||
import * as perfHooks from "node:perf_hooks";
|
||||
import { performance } from "node:perf_hooks";
|
||||
import { performance, PerformanceObserver } from "node:perf_hooks";
|
||||
import { assertEquals, assertThrows } from "@std/assert/mod.ts";
|
||||
|
||||
Deno.test({
|
||||
|
@ -44,9 +44,10 @@ Deno.test({
|
|||
});
|
||||
|
||||
Deno.test({
|
||||
name: "[perf_hooks] PerformanceEntry",
|
||||
name: "[perf_hooks] PerformanceEntry & PerformanceObserver",
|
||||
fn() {
|
||||
assertEquals<unknown>(perfHooks.PerformanceEntry, PerformanceEntry);
|
||||
assertEquals<unknown>(perfHooks.PerformanceObserver, PerformanceObserver);
|
||||
},
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue