Fix Webpack modules that are not arrow funcs, Part II
This commit is contained in:
parent
64aed87de4
commit
13c73699e9
@ -58,9 +58,9 @@ function patchPush() {
|
|||||||
// cause issues.
|
// cause issues.
|
||||||
let code: string = mod.toString().replaceAll("\n", "");
|
let code: string = mod.toString().replaceAll("\n", "");
|
||||||
// a very small minority of modules use function() instead of arrow functions,
|
// a very small minority of modules use function() instead of arrow functions,
|
||||||
// but, unnamed toplevel functions aren't valid. Thus, give those a name
|
// but, unnamed toplevel functions aren't valid. However 0, function() makes it a statement
|
||||||
if (code.startsWith("function(")) {
|
if (code.startsWith("function(")) {
|
||||||
code = "function patchedModule" + code.slice("function".length);
|
code = "0," + code;
|
||||||
}
|
}
|
||||||
const originalMod = mod;
|
const originalMod = mod;
|
||||||
const patchedBy = new Set();
|
const patchedBy = new Set();
|
||||||
|
Loading…
Reference in New Issue
Block a user