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 260194 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]
Tests
changes (16).patch (text/plain), 8.86 KB, created by
Curtis Windatt
on 2016-03-09 16:26:21 EST
(
hide
)
Description:
Tests
Filename:
MIME Type:
Creator:
Curtis Windatt
Created:
2016-03-09 16:26:21 EST
Size:
8.86 KB
patch
obsolete
>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 be6022b..2bed1d1 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 >@@ -7701,6 +7701,217 @@ > ); > }); > }); >+ //NO-UNDEF-EXPRESSION ----------------------------------------------------- >+ describe('no-undef-expression', function() { >+ var RULE_ID = "no-undef-expression"; >+ //------------------------------------------------------------------------------ >+ // Test undeclared globals >+ //------------------------------------------------------------------------------ >+ it("Single file undeclared member", function(callback) { >+ var topic = "var v = {a: function(){}}; v.b();"; >+ var config = { rules: {} }; >+ config.rules[RULE_ID] = 1; >+ validate({buffer: topic, callback: callback, config: config}).then( >+ function (problems) { >+ assertProblems(problems, [ >+ { >+ id: RULE_ID, >+ severity: 'warning', >+ description: "'b' is undefined.", >+ nodeType: "Identifier" >+ }]); >+ }, >+ function (error) { >+ worker.getTestState().callback(error); >+ }); >+ }); >+ it("Single file declared member", function(callback) { >+ var topic = "var v = {a: function(){}}; v.a();"; >+ 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); >+ }); >+ }); >+ // Right now we assume a type with no properties means that Tern is missing the necessary information >+ it("Single file undeclared member object has no properties", function(callback) { >+ var topic = "var v = {}; v.a;"; >+ 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); >+ }); >+ }); >+ it("Single file multiple undeclared members", function(callback) { >+ var topic = "var v = {a: function(){}}; v.b(); v.c()"; >+ var config = { rules: {} }; >+ config.rules[RULE_ID] = 1; >+ validate({buffer: topic, callback: callback, config: config}).then( >+ function (problems) { >+ assertProblems(problems, [ >+ { >+ id: RULE_ID, >+ severity: 'warning', >+ description: "'b' is undefined.", >+ nodeType: "Identifier" >+ }, >+ { >+ id: RULE_ID, >+ severity: 'warning', >+ description: "'c' is undefined.", >+ nodeType: "Identifier" >+ }]); >+ }, >+ function (error) { >+ worker.getTestState().callback(error); >+ }); >+ }); >+ it.skip("Single file wrong undeclared members", function(callback) { >+ var topic = "var v = {a: function(){}}; v.b(); v.c()"; >+ var config = { rules: {} }; >+ config.rules[RULE_ID] = 1; >+ validate({buffer: topic, callback: callback, config: config}).then( >+ function (problems) { >+ assertProblems(problems, [ >+ { >+ id: RULE_ID, >+ severity: 'warning', >+ description: "'b' is undefined.", >+ nodeType: "Identifier" >+ }, >+ { >+ id: RULE_ID, >+ severity: 'warning', >+ description: "'c' is undefined.", >+ nodeType: "Identifier" >+ }]); >+ }, >+ function (error) { >+ worker.getTestState().callback(error); >+ }); >+ }); >+ it("Single file multiple member expression", function(callback) { >+ var topic = "var v = {a: {b: {c: function(){}}}}; v.a.b.d(); v.b();"; >+ var config = { rules: {} }; >+ config.rules[RULE_ID] = 1; >+ validate({buffer: topic, callback: callback, config: config}).then( >+ function (problems) { >+ assertProblems(problems, [ >+ { >+ id: RULE_ID, >+ severity: 'warning', >+ description: "'d' is undefined.", >+ nodeType: "Identifier" >+ }, >+ { >+ id: RULE_ID, >+ severity: 'warning', >+ description: "'b' is undefined.", >+ nodeType: "Identifier" >+ }]); >+ }, >+ function (error) { >+ worker.getTestState().callback(error); >+ }); >+ }); >+ // TODO Tern only finds the property of v if you run open Decl on a() >+ it.skip("Single file member declared inline", function(callback) { >+ var topic = "var v = {}; v.a = function(){}; v.a();"; >+ var config = { rules: {} }; >+ config.rules[RULE_ID] = 1; >+ validate({buffer: topic, callback: callback, config: config}).then( >+ function (problems) { >+ assertProblems(problems, [ >+ { >+ id: RULE_ID, >+ severity: 'warning', >+ description: "'a' is undefined.", >+ nodeType: "Identifier" >+ }]); >+ }, >+ function (error) { >+ worker.getTestState().callback(error); >+ }); >+ }); >+ // TODO We check that the property exists, not the actual property type >+ it.skip("Single file declared property is wrong type", function(callback) { >+ var topic = "var v = {a: {}}; v.a();"; >+ var config = { rules: {} }; >+ config.rules[RULE_ID] = 1; >+ validate({buffer: topic, callback: callback, config: config}).then( >+ function (problems) { >+ assertProblems(problems, [ >+ { >+ id: RULE_ID, >+ severity: 'warning', >+ description: "'a' is undefined.", >+ nodeType: "Identifier" >+ }]); >+ }, >+ function (error) { >+ worker.getTestState().callback(error); >+ }); >+ }); >+ //------------------------------------------------------------------------------ >+ // Test references to globals in other files that Tern knows about >+ //------------------------------------------------------------------------------ >+ it("Multi file 1 - undeclared member", function(callback) { >+ worker.postMessage({request: 'addFile', args: {file: "noUndefExprTest1.js", source: "var noUndefExpr1 = {a: function(){}};"}}); >+ var topic = "noUndefExpr1.b();"; >+ var config = { rules: {} }; >+ config.rules[RULE_ID] = 1; >+ validate({buffer: topic, callback: callback, config: config}).then( >+ function (problems) { >+ assertProblems(problems, [{ >+ id: RULE_ID, >+ severity: 'warning', >+ description: "'b' is undefined.", >+ nodeType: "Identifier" >+ }]); >+ }, >+ function (error) { >+ worker.getTestState().callback(error); >+ } >+ ); >+ }); >+ it("Multi file 2 - declared member", function(callback) { >+ worker.postMessage({request: 'addFile', args: {file: "noUndefExprTest2.js", source: "var noUndefExpr2 = {a: function(){}};"}}); >+ var topic = "noUndefExpr2.a();"; >+ 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); >+ } >+ ); >+ }); >+ it("Multi file 3 - undeclared member no properties", function(callback) { >+ worker.postMessage({request: 'addFile', args: {file: "noUndefExprTest3.js", source: "var noUndefExpr3 = {};"}}); >+ var topic = "noUndefExpr3.a();"; >+ 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() { > var RULE_ID = "no-undef-init";
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