-
-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Add an option to apply compatibility fixes even if they’re not needed by the current environment. This would be useful when serializing transpiled patterns for later use.
Context
Oniguruma-To-ES 3.1.1 added an environment-specific workaround (#30) to handle a WebKit bug that was reported in Shiki. The workaround is applied only when the environment that Oniguruma-To-ES is running in has the bug. That means if you serialize output in an environment that doesn't include the bug and then construct an affected regex in an environment that does, the regex won't work correctly.
Proposed solution
Add an option to toRegExp/toRegExpDetails called e.g. includeAllEnvFixes that applies all environment-specific workarounds during transpilation, even if they aren't needed in the current environment.