Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 461461

Summary: [eslint] Incomplete member expression throws exception in no-iterator rule
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 8.0   
Target Milestone: 9.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Michael Rennie CLA 2015-03-04 21:28:44 EST
Consider the following snippet:

/* eslint-disable no-unused-vars */
var o = {
    a: function a() {
        var that = this;
        return function() {
            that.b();
            that.
        };
    },
    b: function b() {
        //
    }
};

Saving it causes an exception to be thrown, which is trapped by the rule and swallowed silently. Here is the trapped exception:

"TypeError: Cannot read property 'name' of null
    at EventEmitter.rules.no-iterator.rule.MemberExpression (http://mrennie-new-target.orion.eclipse.org:9000/eslint/lib/load-rules-async.js:604:48)
    at http://mrennie-new-target.orion.eclipse.org:9000/eslint/lib/events.js:109:14
    at Array.forEach (native)
    at EventEmitter.emit (http://mrennie-new-target.orion.eclipse.org:9000/eslint/lib/events.js:107:14)
    at Controller.module.exports.api.verify.controller.traverse.enter (http://mrennie-new-target.orion.eclipse.org:9000/eslint/lib/eslint.js:625:25)
    at Controller.__execute (http://mrennie-new-target.orion.eclipse.org:9000/estraverse/estraverse.js:317:31)
    at Controller.traverse (http://mrennie-new-target.orion.eclipse.org:9000/estraverse/estraverse.js:393:28)
    at EventEmitter.module.exports.api.verify (http://mrennie-new-target.orion.eclipse.org:9000/eslint/lib/eslint.js:618:24)
    at ESLintValidator.Objects.mixin._validateAst (http://mrennie-new-target.orion.eclipse.org:9000/javascript/validator.js:294:27)
    at http://mrennie-new-target.orion.eclipse.org:9000/javascript/validator.js:274:23"