block by Hypercubed 89808f3051101a1a97f3

Bad value context for arguments value

Full Screen

“Not optimized: Bad value context for arguments value”

Adding a property to one function, but not all functions, causes Not optimized flag on function containing Function.prototype.apply.

Cause

“V8 only recognizes monomorphic .apply call-sites” - @mraleph

Example

See example.js

Fixes

Test in node

node --trace_opt --trace_deopt example.js | grep "failed to optimize dispatch"

Test in browser

jspm install
http-server  # open http://localhost:8080/

index.html

config.js

example.js

example2.js

fix.js

package.json