Sfoglia il codice sorgente

fix: Make polyfilled import.meta.filename getter a valid function

Sam Atkins 11 mesi fa
parent
commit
85c6798448
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      run-selfhosted.js

+ 1 - 1
run-selfhosted.js

@@ -55,7 +55,7 @@ const surrounding_box = (col, lines) => {
 // Annoying polyfill for inconsistency in different node versions
 // Annoying polyfill for inconsistency in different node versions
 if ( ! import.meta.filename ) {
 if ( ! import.meta.filename ) {
     Object.defineProperty(import.meta, 'filename', {
     Object.defineProperty(import.meta, 'filename', {
-        get: import.meta.url.slice('file://'.length),
+        get: () => import.meta.url.slice('file://'.length),
     })
     })
 }
 }