mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
e7163b6720
## Summary close: #13067 Part of https://github.com/oxc-project/oxc/issues/19673 Depends on #20217. Port known-globals lists from Rolldown to Oxc's side-effect detection: - **Global identifiers** (Math, Array, console, DOM classes, etc.) are now considered side-effect-free to access via `is_known_global_identifier`, matching Rolldown's `GLOBAL_IDENT` set - **Property reads** like `Math.PI`, `console.log`, `Object.keys` are considered side-effect-free via `is_known_global_property` - **3-level chains** like `Object.prototype.hasOwnProperty` are supported via `is_known_global_property_deep` ## Test plan - [x] Added tests for known global identifiers (Math, Array, Object, console, etc.) - [x] Added tests for known global property reads (Math.PI, Object.keys, etc.) - [x] Added tests for 3-level chains (Object.prototype.hasOwnProperty, etc.) - [x] Existing minifier test expectations updated for improved side-effect detection - [x] All existing tests pass 🤖 Generated with [Claude Code](https://claude.com/claude-code)
213 KiB
213 KiB