Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 262518 Details for
Bug 496313
Wrong no-undef-expression error reported for array access
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed patch including regression tests
changes (1).patch (text/plain), 2.68 KB, created by
Olivier Thomann
on 2016-06-17 13:43:42 EDT
(
hide
)
Description:
Proposed patch including regression tests
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2016-06-17 13:43:42 EDT
Size:
2.68 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/load-rules-async.js b/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/load-rules-async.js >index d32f874..2e0fa73 100644 >--- a/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/load-rules-async.js >+++ b/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/load-rules-async.js >@@ -1366,14 +1366,17 @@ define([ > }, > /** @callback */ > 'no-undef-expression': function(context){ >- return { >- /* @callback */ >- 'MemberExpression': function(node){ >- if (node.property && node.object && node.object.type !== 'ThisExpression'){ >- if (node.parent && node.parent.type === 'CallExpression' && node.parent.callee && node.parent.callee === node){ >- var tern = context.getTern(); >- var propName = node.property.name ? node.property.name : node.property.value; >+ return { >+ /* @callback */ >+ 'MemberExpression': function(node){ >+ if (node.property && node.object && node.object.type !== 'ThisExpression'){ >+ if (node.parent && node.parent.type === 'CallExpression' && node.parent.callee && node.parent.callee === node){ >+ var propName = node.property.name ? node.property.name : node.property.value; >+ if (!propName) { >+ return; >+ } > var query = {start: node.property.start, end: node.property.end}; >+ var tern = context.getTern(); > var expr = tern.findQueryExpr(tern.file, query); > if (!expr) { > // no expression found. No need to look for the type >diff --git a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/validatorTests.js b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/validatorTests.js >index 9d61d62..3b13cda 100644 >--- a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/validatorTests.js >+++ b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/validatorTests.js >@@ -8559,6 +8559,19 @@ define([ > } > ); > }); >+ it("Should not flag array access using a binary expression", function(callback) { >+ var topic = "var funcs = [], i = 5; return funcs[i - 1]();"; >+ var config = { rules: {} }; >+ config.rules[RULE_ID] = 1; >+ validate({buffer: topic, callback: callback, config: config}).then( >+ function (problems) { >+ assertProblems(problems, [ >+ ]); >+ }, >+ function (error) { >+ worker.getTestState().callback(error); >+ }); >+ }); > }); > //NO-UNDEF-INIT ------------------------------------------------- > describe('no-unreachable', function() {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 496313
: 262518