rspec/rules/S3757/javascript/comments-and-links.adoc

21 lines
1.2 KiB
Plaintext
Raw Normal View History

=== On 2016-10-18T10:47:28Z Pierre-Yves Nicolas Wrote:
We may raise false positives when one of the operands is an ``++Object++``. An ``++Object++`` which wraps some kind of number may have a valid ``++valueOf++`` method: see https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf#Examples[an example].
If we see that we raise too many false positives, we can:
* raise an issue only on some kinds of ``++Object++`` for which we know that there is a problem: ``++Array++``, ``++Date++``, ``++Function++``, ``++Regexp++``
* keep the same exception on ``+`` for these kinds of operand
=== On 2016-10-25T15:44:36Z Pierre-Yves Nicolas Wrote:
\[~jeanchristophe.collet] I think that the message should always be "imperative", e.g. "Remove...", "Change...".
=== On 2016-10-25T15:47:45Z Pierre-Yves Nicolas Wrote:
\[~jeanchristophe.collet] What about ``+++=++``?
=== On 2016-10-25T16:01:10Z Jean-Christophe Collet Wrote:
I addressed both comments above.
=== On 2016-10-31T12:24:53Z Pierre-Yves Nicolas Wrote:
More detailed message: "The value of this operand is (undefined|an object) on at least one path of execution. Refactor the code to avoid having NaN ("Not a Number") as the result of the parent expression."