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 239808 Details for
Bug 427836
[occurrences] Incorrect handling of NewExpression
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]
fix
new-expression.patch (text/plain), 4.31 KB, created by
Michael Rennie
on 2014-02-10 22:10:28 EST
(
hide
)
Description:
fix
Filename:
MIME Type:
Creator:
Michael Rennie
Created:
2014-02-10 22:10:28 EST
Size:
4.31 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/occurrences.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/occurrences.js >index 04db19b..ab0dbf9 100644 >--- a/bundles/org.eclipse.orion.client.javascript/web/javascript/occurrences.js >+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/occurrences.js >@@ -144,6 +144,12 @@ > break; > case Estraverse.Syntax.NewExpression: > this.checkId(node.callee, false); >+ if(node.arguments) { >+ var len = node.arguments.length; >+ for(var m = 0; m < len; m++) { >+ this.checkId(node.arguments[m]); >+ } >+ } > break; > case Estraverse.Syntax.LogicalExpression: > this.checkId(node.left); >diff --git a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/occurrencesTests.js b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/occurrencesTests.js >index a309edf..63529f9 100644 >--- a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/occurrencesTests.js >+++ b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/occurrencesTests.js >@@ -916,5 +916,101 @@ > } > }); > }; >+ >+ /** >+ * Tests logic expressions that contain identifier nodes >+ * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=427836 >+ */ >+ Tests.test_newExpression1 = function() { >+ editorContext.text = "var foo = 1;function f1() {};var bar = new f1(foo);"; >+ return occurrences.computeOccurrences(editorContext, setContext(6, 6)).then(function(results) { >+ try { >+ assertOccurrences(results, [{start:4, end:7}, {start:46, end:49}]); >+ } >+ finally { >+ tearDown(); >+ } >+ }); >+ }; >+ >+ /** >+ * Tests logic expressions that contain identifier nodes >+ * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=427836 >+ */ >+ Tests.test_newExpression2 = function() { >+ editorContext.text = "var foo = 1;function f1() {};var bar = new f1(foo);"; >+ return occurrences.computeOccurrences(editorContext, setContext(48, 48)).then(function(results) { >+ try { >+ assertOccurrences(results, [{start:4, end:7}, {start:46, end:49}]); >+ } >+ finally { >+ tearDown(); >+ } >+ }); >+ }; >+ >+ /** >+ * Tests logic expressions that contain identifier nodes >+ * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=427836 >+ */ >+ Tests.test_newExpression3 = function() { >+ editorContext.text = "var foo = 1;function f1() {};var o = {a: function() {var bar = new f1(foo);}}"; >+ return occurrences.computeOccurrences(editorContext, setContext(6, 6)).then(function(results) { >+ try { >+ assertOccurrences(results, [{start:4, end:7}, {start:70, end:73}]); >+ } >+ finally { >+ tearDown(); >+ } >+ }); >+ }; >+ >+ /** >+ * Tests logic expressions that contain identifier nodes >+ * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=427836 >+ */ >+ Tests.test_newExpression4 = function() { >+ editorContext.text = "var foo = 1;function f1() {};var o = {a: function() {var bar = new f1(foo);}}"; >+ return occurrences.computeOccurrences(editorContext, setContext(72, 72)).then(function(results) { >+ try { >+ assertOccurrences(results, [{start:4, end:7}, {start:70, end:73}]); >+ } >+ finally { >+ tearDown(); >+ } >+ }); >+ }; >+ >+ /** >+ * Tests logic expressions that contain identifier nodes >+ * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=427836 >+ */ >+ Tests.test_newExpression5 = function() { >+ editorContext.text = "var foo = 1;function f1() {};function f2() {var bar = new f1(foo);}"; >+ return occurrences.computeOccurrences(editorContext, setContext(6, 6)).then(function(results) { >+ try { >+ assertOccurrences(results, [{start:4, end:7}, {start:61, end:64}]); >+ } >+ finally { >+ tearDown(); >+ } >+ }); >+ }; >+ >+ /** >+ * Tests logic expressions that contain identifier nodes >+ * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=427836 >+ */ >+ Tests.test_newExpression6 = function() { >+ editorContext.text = "var foo = 1;function f1() {};function f2() {var bar = new f1(foo);}"; >+ return occurrences.computeOccurrences(editorContext, setContext(62, 62)).then(function(results) { >+ try { >+ assertOccurrences(results, [{start:4, end:7}, {start:61, end:64}]); >+ } >+ finally { >+ tearDown(); >+ } >+ }); >+ }; > return Tests; > }); >\ No newline at end of file
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 427836
: 239808