Commit e3d7c7d
Add runtime check to isLookbehindSupported() to prevent SyntaxError on older browsers (#8353)
The UA-based isLookbehindSupported() can return true for unrecognized
browsers (e.g. in-app WebViews, Chrome on old iOS using WebKit), causing
highlight.ts to load highlightjs-roc which contains regex literals with
lookbehind assertions. This triggers a fatal SyntaxError during module
parsing on browsers that don't support lookbehinds.
Adding areAllRegExpFeaturesSupported() as a runtime check before UA
sniffing ensures the guard works correctly even when UA detection fails.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 48f09bf commit e3d7c7d
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
0 commit comments