#6538·rollup

`tryCatchDeoptimization` misses a callback when the helper is a property

Author: slowcheetahCreated Sep 28, 2026Updated Sep 29, 2026
Labelst¹ 🐞 bug

Rollup Version

4.63.5

Operating System (or Browser)

Ubuntu 22.04

Node Version (if applicable)

26.8.1

Link To Reproduction

https://rollupjs.org/repl/?version=4.63.5&shareable=eyJleGFtcGxlIjoiIiwibW9kdWxlcyI6W3siY29kZSI6ImNvbnN0IGhlbHBlcnMgPSB7IGZhaWxzOiBleGVjID0-IHsgdHJ5IHsgZXhlYygpOyByZXR1cm4gZmFsc2U7IH0gY2F0Y2ggeyByZXR1cm4gdHJ1ZTsgfSB9IH07XG5leHBvcnQgZGVmYXVsdCBoZWxwZXJzLmZhaWxzKCgpID0-IHsgT2JqZWN0LmdldFByb3RvdHlwZU9mKG51bGwpOyB9KTsiLCJpc0VudHJ5Ijp0cnVlLCJuYW1lIjoibWFpbi5qcyJ9XSwib3B0aW9ucyI6e319

Expected Behaviour

Object.getPrototypeOf(null) throws on every engine, so this module evaluates to true, and should still do so after bundling: the callback is provided directly as an argument and the helper calls it inside try, which is the case tryCatchDeoptimization keeps (#2918).

javascript
const helpers = { fails: exec => { try { exec(); return false; } catch { return true; } } };
export default helpers.fails(() => { Object.getPrototypeOf(null); });

Actual Behaviour

The call is removed, so the bundle evaluates to false:

javascript
const helpers = { fails: exec => { try { exec(); return false; } catch { return true; } } };
var entry = helpers.fails(() => { });   // <- the call is gone

export { entry as default };