v8-bailout-reasons
v8-bailout-reasons copied to clipboard
'Assignment to parameter in arguments object' in strict mode
function testFuncDeopt(namedArg) {
const baz = arguments[0];
namedArg = 'bar';
function inner() { return namedArg; }
}
for (let i = 0; i < 1e3; i++) testFuncDeopt('foo');
There should be 3 conditions:
-
arguments
mention (arguments
,arguments[i]
,arguments.length
). - Named parameter leaking in a lower scope.
- Named parameter reassignment (it should be reassigned in the parent scope; reassignment in the lower scope does not cause deopt).