Skip to content

Commit

Permalink
Update fileUtils.js to avoid error messages (#11715)
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiux committed Jun 21, 2023
1 parent 7f86417 commit 127e3c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/misc/fileUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,16 @@ function unloadModule(index) {

function createExports({path, dir, meta, type, file, size, JS, returnIndex, reject}) {
// Import data is stored in an array of objects and the module index is looked up by path.
let importerData = {
var importerData = { // changed from 'let' to 'var'.
size,
path,
dir,
module: null
};
// module.exports as an object holding a module's namespaces is a node convention, and is intended
// to help interop with other libraries.
const exports = {};
const module = {
var exports = {}; // changed from 'const' to 'var'.
var module = { // changed from 'const' to 'var'.
exports: exports
};

Expand All @@ -177,7 +177,7 @@ function createExports({path, dir, meta, type, file, size, JS, returnIndex, reje
// mimicking the native CJS importer.
const exportsRegex = /^module\.exports(\.[a-zA-Z0-9_$]+)?\s*=/m;
const varRegex = /^(?:'use strict';){0,}(const|var|let|function|class)\s+([a-zA-Z0-9_$]+)/gm;
let match;
var match; // changed from 'let' to 'var'.

if (!exportsRegex.test(JS)) {
while ((match = varRegex.exec(JS)) != null) {
Expand Down

0 comments on commit 127e3c5

Please sign in to comment.