Skip to content

Commit f193f8f

Browse files
authored
1 parent fafb337 commit f193f8f

File tree

6 files changed

+6
-26
lines changed

6 files changed

+6
-26
lines changed

cjs/interface/document.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
'use strict';
2-
const {performance} = require('../../commonjs/perf_hooks.cjs');
3-
42
const {DOCUMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, SVG_NAMESPACE} = require('../shared/constants.js');
53

64
const {
@@ -120,7 +118,7 @@ class Document extends NonElementParentNode {
120118
this[CUSTOM_ELEMENTS] = new CustomElementRegistry(this);
121119
return this[CUSTOM_ELEMENTS];
122120
case 'performance':
123-
return performance;
121+
return globalThis.performance;
124122
case 'DOMParser':
125123
return this[DOM_PARSER];
126124
case 'Image':

commonjs/perf_hooks.cjs

Lines changed: 0 additions & 9 deletions
This file was deleted.

esm/interface/document.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import {performance} from '../../commonjs/perf_hooks.cjs';
2-
31
import {DOCUMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, SVG_NAMESPACE} from '../shared/constants.js';
42

53
import {
@@ -120,7 +118,7 @@ export class Document extends NonElementParentNode {
120118
this[CUSTOM_ELEMENTS] = new CustomElementRegistry(this);
121119
return this[CUSTOM_ELEMENTS];
122120
case 'performance':
123-
return performance;
121+
return globalThis.performance;
124122
case 'DOMParser':
125123
return this[DOM_PARSER];
126124
case 'Image':

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@
7676
"htmlparser2": "^10.0.0",
7777
"uhyphen": "^0.2.0"
7878
},
79+
"engines": {
80+
"node": ">=16"
81+
},
7982
"repository": {
8083
"type": "git",
8184
"url": "git+https://github.com/WebReflection/linkedom.git"

rollup/es.config.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,12 @@ export default {
1919
function shims() {
2020
return {
2121
resolveId(specifier) {
22-
if(specifier.endsWith('perf_hooks.cjs')) {
23-
return 'shim:perf_hooks';
24-
}
2522
if(specifier.endsWith('canvas.cjs')) {
2623
return 'shim:canvas';
2724
}
2825
},
2926
load(id) {
3027
switch(id) {
31-
case 'shim:perf_hooks': {
32-
return `
33-
export const performance = globalThis.performance;
34-
`;
35-
}
3628
case 'shim:canvas': {
3729
return `
3830
class Canvas {

worker.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4229,8 +4229,6 @@ const registerHTMLClass = (names, Class) => {
42294229
}
42304230
};
42314231

4232-
const performance = globalThis.performance;
4233-
42344232
const loopSegment = ({[NEXT]: next, [END]: end}, json) => {
42354233
while (next !== end) {
42364234
switch (next.nodeType) {
@@ -12322,7 +12320,7 @@ let Document$1 = class Document extends NonElementParentNode {
1232212320
this[CUSTOM_ELEMENTS] = new CustomElementRegistry(this);
1232312321
return this[CUSTOM_ELEMENTS];
1232412322
case 'performance':
12325-
return performance;
12323+
return globalThis.performance;
1232612324
case 'DOMParser':
1232712325
return this[DOM_PARSER];
1232812326
case 'Image':

0 commit comments

Comments
 (0)