[eslint] TypeError: Cannot read property 'name' of undefined

RESOLVED FIXED in Firefox 68

Status

defect
P2
normal
RESOLVED FIXED
4 months ago
4 months ago

People

(Reporter: glasserc, Assigned: standard8)

Tracking

unspecified
mozilla68

Firefox Tracking Flags

(firefox68 fixed)

Details

Attachments

(1 attachment)

Trying to lint a file (in particular https://phabricator.services.mozilla.com/D29873#change-QXf8nf63T8qQ) produces this:

An error occurred running eslint. Please check the following error messages:

TypeError: Cannot read property 'name' of undefined
Occurred while linting /home/ethan/Jobs/Mozilla/gecko-git/toolkit/components/normandy/actions/SinglePreferenceExperimentAction.jsm:22
    at VariableDeclarator (/home/ethan/Jobs/Mozilla/gecko-git/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/no-define-cc-etc.js:31:59)
    at listeners.(anonymous function).forEach.listener (/home/ethan/Jobs/Mozilla/gecko-git/node_modules/eslint/lib/util/safe-emitter.js:45:58)
    at Array.forEach (<anonymous>)
    at Object.emit (/home/ethan/Jobs/Mozilla/gecko-git/node_modules/eslint/lib/util/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/home/ethan/Jobs/Mozilla/gecko-git/node_modules/eslint/lib/util/node-event-generator.js:251:26)
    at NodeEventGenerator.applySelectors (/home/ethan/Jobs/Mozilla/gecko-git/node_modules/eslint/lib/util/node-event-generator.js:280:22)
    at NodeEventGenerator.enterNode (/home/ethan/Jobs/Mozilla/gecko-git/node_modules/eslint/lib/util/node-event-generator.js:294:14)
    at CodePathAnalyzer.enterNode (/home/ethan/Jobs/Mozilla/gecko-git/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:632:23)
    at nodeQueue.forEach.traversalInfo (/home/ethan/Jobs/Mozilla/gecko-git/node_modules/eslint/lib/linter.js:752:32)
    at Array.forEach (<anonymous>)
A failure occurred in the eslint linter.
✖ 1 problem (0 errors, 0 warnings, 1 failure)

I think this is due to use of the "rest" spread.

Summary: TypeError: Cannot read property 'name' of undefined → [eslint] TypeError: Cannot read property 'name' of undefined

Thanks for filing, you're quite right, we're not handling the different type of the spread properly.

Assignee: nobody → standard8
Status: NEW → ASSIGNED
Priority: -- → P2
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/eea0648e7d30
Fix handling of spread operators when checking the ESLint rule no-define-cc-etc. r=dthayer
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.