diff options
author | Vendicated <vendicated@riseup.net> | 2022-11-01 15:06:15 +0100 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2022-11-01 15:06:15 +0100 |
commit | 13c73699e98196ae57dd5fbd9ee5e47366055ab3 (patch) | |
tree | bb4dafe46a038c64df69f6d93340fa1d1727a180 /src/webpack/patchWebpack.ts | |
parent | 64aed87de41ecc614f742f999989f32e42826ea2 (diff) | |
download | Vencord-13c73699e98196ae57dd5fbd9ee5e47366055ab3.tar.gz Vencord-13c73699e98196ae57dd5fbd9ee5e47366055ab3.tar.bz2 Vencord-13c73699e98196ae57dd5fbd9ee5e47366055ab3.zip |
Fix Webpack modules that are not arrow funcs, Part II
Diffstat (limited to 'src/webpack/patchWebpack.ts')
-rw-r--r-- | src/webpack/patchWebpack.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/webpack/patchWebpack.ts b/src/webpack/patchWebpack.ts index fa6767c..679d481 100644 --- a/src/webpack/patchWebpack.ts +++ b/src/webpack/patchWebpack.ts @@ -58,9 +58,9 @@ function patchPush() { // cause issues. let code: string = mod.toString().replaceAll("\n", ""); // 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(")) { - code = "function patchedModule" + code.slice("function".length); + code = "0," + code; } const originalMod = mod; const patchedBy = new Set(); |