Open Bug 1458987 Opened 6 years ago Updated 2 years ago

Consider being more strict with array parameters in XPConnect

Categories

(Core :: XPConnect, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: nika, Unassigned)

Details

Currently XPConnect is not strict with array parameters. If a non-array value is passed as an array to a function with an optional length parameter, it is interpreted in native code as an array of 0 length. This is due to checks like https://searchfox.org/mozilla-central/rev/ce9ff94ffed34dc17ec0bfa406156d489eaa8ee1/js/xpconnect/src/XPCWrappedJSClass.cpp#1350 which short-circuit conversion when the length is 0.

We depend on this in tests like https://searchfox.org/mozilla-central/rev/ce9ff94ffed34dc17ec0bfa406156d489eaa8ee1/intl/locale/tests/unit/test_localeService_negotiateLanguages.js#92. We can (and probably should) change this behaviour, but we will need to fix these tests.
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.