options variable is not undefined when failed to parse BUILD_CONFIG in gaia/build/xpcshell-commonjs.js.

NEW
Unassigned

Status

Firefox OS
Gaia::Build
2 years ago
2 years ago

People

(Reporter: arai, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
https://github.com/mozilla-b2g/gaia/blob/master/build/xpcshell-commonjs.js#L70

xpcshell has built-in "options" function, and currently SpiderMonkey's global let is not ES6 compliant and it's semantically equivalent to global var (bug 589199). so "let options;" there does nothing and "options" stays to be the built-in function.

Then, iiuc, following line expects "options" to be undefined when JSON.parse fails, but it won't be undefined.
https://github.com/mozilla-b2g/gaia/blob/master/build/xpcshell-commonjs.js#L73

it would be better to rename the "options" variable to some other name for now.
You need to log in before you can comment on or make changes to this bug.