Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 496313
Collapse All | Expand All

(-)a/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/load-rules-async.js (-7 / +10 lines)
Lines 1366-1379 define([ Link Here
1366
        },
1366
        },
1367
        /** @callback */
1367
        /** @callback */
1368
        'no-undef-expression': function(context){
1368
        'no-undef-expression': function(context){
1369
        	return {
1369
			return {
1370
        		/* @callback */
1370
				/* @callback */
1371
        		'MemberExpression': function(node){
1371
				'MemberExpression': function(node){
1372
                	if (node.property && node.object && node.object.type !== 'ThisExpression'){
1372
					if (node.property && node.object && node.object.type !== 'ThisExpression'){
1373
                		if (node.parent && node.parent.type === 'CallExpression' && node.parent.callee && node.parent.callee === node){
1373
						if (node.parent && node.parent.type === 'CallExpression' && node.parent.callee && node.parent.callee === node){
1374
                			var tern = context.getTern();
1374
							var propName = node.property.name ? node.property.name : node.property.value;
1375
                			var propName = node.property.name ? node.property.name : node.property.value;
1375
							if (!propName) {
1376
								return;
1377
							}
1376
							var query = {start: node.property.start, end: node.property.end};
1378
							var query = {start: node.property.start, end: node.property.end};
1379
							var tern = context.getTern();
1377
							var expr = tern.findQueryExpr(tern.file, query);
1380
							var expr = tern.findQueryExpr(tern.file, query);
1378
							if (!expr) {
1381
							if (!expr) {
1379
								// no expression found. No need to look for the type
1382
								// no expression found. No need to look for the type
(-)a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/validatorTests.js (+13 lines)
Lines 8559-8564 define([ Link Here
8559
								}
8559
								}
8560
							);
8560
							);
8561
						});
8561
						});
8562
						it("Should not flag array access using a binary expression", function(callback) {
8563
							var topic = "var funcs = [], i = 5; return funcs[i - 1]();";
8564
							var config = { rules: {} };
8565
							config.rules[RULE_ID] = 1;
8566
							validate({buffer: topic, callback: callback, config: config}).then(
8567
								function (problems) {
8568
									assertProblems(problems, [
8569
									]);
8570
								},
8571
								function (error) {
8572
									worker.getTestState().callback(error);
8573
								});
8574
						});
8562
					});
8575
					});
8563
					//NO-UNDEF-INIT -------------------------------------------------
8576
					//NO-UNDEF-INIT -------------------------------------------------
8564
					describe('no-unreachable', function() {
8577
					describe('no-unreachable', function() {

Return to bug 496313