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 263679 Details for
Bug 500005
Deleting a quote can cause the whole file to go red...
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
500005.patch (text/plain), 1.70 KB, created by
Olivier Thomann
on 2016-08-19 16:09:38 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2016-08-19 16:09:38 EDT
Size:
1.70 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/rules/no-unused-expressions.js b/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/rules/no-unused-expressions.js >index c583bd2..c427107 100644 >--- a/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/rules/no-unused-expressions.js >+++ b/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/rules/no-unused-expressions.js >@@ -1,5 +1,8 @@ > /*eslint-env amd */ >-define(function(module) { >+define([ >+'estraverse/estraverse', >+'module' >+], function(Estraverse, module) { > //------------------------------------------------------------------------------ > // Rule Definition > //------------------------------------------------------------------------------ >@@ -74,10 +77,29 @@ define(function(module) { > return /^(?:Assignment|Call|New|Update|Yield)Expression$/.test(node.type) || > (node.type === "UnaryExpression" && ["delete", "void"].indexOf(node.operator) >= 0); > } >+ >+ function isRecoveredNode(currentNode) { >+ var result = false; > >+ Estraverse.traverse(currentNode, { >+ /** >+ * @callback >+ */ >+ enter: function(node, parent) { >+ if (node.range && node.range[0] === node.range[1]) { >+ result = true; >+ return Estraverse.VisitorOption.Break; >+ } >+ } >+ }); >+ >+ return result; >+ } > return { > "ExpressionStatement": function(node) { >- if (!isValidExpression(node.expression) && !isDirective(node, context.getAncestors())) { >+ if (!isValidExpression(node.expression) >+ && !isDirective(node, context.getAncestors()) >+ && !isRecoveredNode(node.expression)) { > context.report(node, "Expected an assignment or function call and instead saw an expression."); > } > }
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 500005
:
263678
| 263679