Skip to content

Commit b529e80

Browse files
committed
Use primordial
1 parent c6efbac commit b529e80

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/modules/esm/initialize_import_meta.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
22

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

0 commit comments

Comments
 (0)