League-of-Foundry-Developers / fvtt-module-furnace

34 stars 12 forks source link

patchClass function does not handle async functions #46

Closed trdischat closed 4 years ago

trdischat commented 4 years ago

Lines 17-18 of Patches.js incorrectly add an extra "function" string to the beginning of an async function, which then gets swapped around by lines 19-20 to read "async function function". Line 17 should be revised as follows:

- if (!fixed.startsWith("function"))
+ if (!(fixed.startsWith("function") || fixed.startsWith("async function")))