21 lines
1.2 KiB
Plaintext
21 lines
1.2 KiB
Plaintext
=== on 18 Oct 2016, 10:47:28 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 25 Oct 2016, 15:44:36 Pierre-Yves Nicolas wrote:
|
|
\[~jeanchristophe.collet] I think that the message should always be "imperative", e.g. "Remove...", "Change...".
|
|
|
|
=== on 25 Oct 2016, 15:47:45 Pierre-Yves Nicolas wrote:
|
|
\[~jeanchristophe.collet] What about ``+++=++``?
|
|
|
|
=== on 25 Oct 2016, 16:01:10 Jean-Christophe Collet wrote:
|
|
I addressed both comments above.
|
|
|
|
=== on 31 Oct 2016, 12:24:53 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."
|
|
|