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 260166 Details for
Bug 488531
[cross file linting] resolve method calls
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]
WIP
changes (15).patch (text/plain), 5.70 KB, created by
Curtis Windatt
on 2016-03-08 17:28:37 EST
(
hide
)
Description:
WIP
Filename:
MIME Type:
Creator:
Curtis Windatt
Created:
2016-03-08 17:28:37 EST
Size:
5.70 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 390c064..2694a35 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 >@@ -1204,6 +1204,62 @@ > }; > }, > /** @callback */ >+ 'no-undef-expression': function(context){ >+ return { >+ 'MemberExpression': function(node){ >+ try { >+ 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 query = tern.query; >+ query.end = node.property.start; >+ var foundType = null; >+ try { >+ var expr = tern.findExpr(tern.file, query); >+ var type = tern.findExprType(tern.server, query, tern.file, expr); >+ if (type && type.origin){ >+ foundType = type; >+ } >+ } catch(e) { >+ //ignore >+ } >+ if (!foundType){ >+ // If the object cannot be found, there is no way the property could be known >+ query.end = node.object.end; >+ try { >+ expr = tern.findExpr(tern.file, query); >+ type = tern.findExprType(tern.server, query, tern.file, expr); >+// if (!type || !type.origin || !type.types || type.types.length === 0){ >+// foundType = true; // TODO type might be null so can't save it >+// } else { >+ if (type && type.types){ >+ // If the type has no known properties assume Tern doens't know enough about it to find the declaration >+ foundType = true; >+ for (var i=0; i<type.types.length; i++) { >+ var currentProps = type.types[i].props; >+ if (currentProps && Object.keys(currentProps).length > 0){ >+ foundType = false; >+ break; >+ } >+ } >+ } >+ } catch (e) { >+ //ignore >+ } >+ if (!foundType){ >+ context.report(node.property, ProblemMessages['no-undef-defined'], {0:node.property.name, nls: 'no-undef-defined'}); //$NON-NLS-1$ >+ } >+ >+ } >+ } >+ } >+ } catch (ex) { >+ Logger.log(ex); >+ } >+ >+ } >+ }; >+ }, > 'no-undef-init': function(context) { > return { > 'VariableDeclarator': function(node) { >diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/nls/root/messages.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/nls/root/messages.js >index d88652c..d9e9055 100644 >--- a/bundles/org.eclipse.orion.client.javascript/web/javascript/nls/root/messages.js >+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/nls/root/messages.js >@@ -70,6 +70,7 @@ > 'varRedecl' : 'Variable re-declarations:', > 'varShadow': 'Variable shadowing:', > 'undefMember' : 'Undeclared global reference:', >+ 'undefExpression' : 'Undeclared member expression reference:', > 'unnecessarySemis' : 'Unnecessary semicolons:', > 'unusedParams' : 'Unused parameters:', > 'unsupportedJSLint' : 'Unsupported environment directive:', >diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/javascriptPlugin.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/javascriptPlugin.js >index 09dbd0a..9ac9d0a 100644 >--- a/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/javascriptPlugin.js >+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/javascriptPlugin.js >@@ -1443,8 +1443,13 @@ > defaultValue: error, > options: severities > }, >- { >- id: "no-else-return", //$NON-NLS-1$ >+ { id: "no-undef-expression", //$NON-NLS-1$ >+ name: javascriptMessages["undefExpression"], >+ type: "number", //$NON-NLS-1$ >+ defaultValue: ignore, >+ options: severities >+ }, >+ { id: "no-else-return", //$NON-NLS-1$ > name: javascriptMessages["no-else-return"], > type: "number", //$NON-NLS-1$ > defaultValue: warning, >diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/ruleData.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/ruleData.js >index b25d462..b5212dd 100644 >--- a/bundles/org.eclipse.orion.client.javascript/web/javascript/ruleData.js >+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/ruleData.js >@@ -65,6 +65,7 @@ > "no-sparse-arrays" : 1, > "no-throw-literal" : 1, > "no-undef" : 2, >+ "no-undef-expression": 0, > "no-undef-init" : 1, > "no-unreachable" : 1, > "no-unused-params" : 1,
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 488531
: 260166 |
260194