Skip to content

Commit

Permalink
Use primordial
Browse files Browse the repository at this point in the history
  • Loading branch information
jsumners committed Jul 12, 2023
1 parent c6efbac commit bcffca1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/internal/modules/esm/initialize_import_meta.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

const { StringPrototypeSlice } = primordials
const { getOptionValue } = require('internal/options');
const { fileURLToPath } = require('url');
const { dirname } = require('path');
Expand Down Expand Up @@ -60,7 +61,7 @@ function initializeImportMeta(meta, context, loader) {
* @returns {{__dirname?: string, __filename?: string}}
*/
function resolveModuleMeta(url) {
if (url.slice(0, 7) !== 'file://') {
if (StringPrototypeSlice(url, 0, 7) !== 'file://') {
// These only make sense for locally loaded modules,
// i.e. network modules are not supported.
return { __dirname: undefined, __filename: undefined };
Expand Down

0 comments on commit bcffca1

Please sign in to comment.