Modify rule S4125: remove types from code examples and add BigInt (#1044)
This commit is contained in:
parent
ff35e55506
commit
a30f04f139
@ -7,6 +7,7 @@ The ``++typeof++`` operator returns a string indicating the type of its argument
|
|||||||
* "symbol" (since ECMAScript 2015)
|
* "symbol" (since ECMAScript 2015)
|
||||||
* "function"
|
* "function"
|
||||||
* "object" (for ``++null++`` and any other object)
|
* "object" (for ``++null++`` and any other object)
|
||||||
|
* "BigInt" (since ECMAScript 2020)
|
||||||
|
|
||||||
Compare a ``++typeof++`` expression to anything else, and the result is predefined: ``++false++``.
|
Compare a ``++typeof++`` expression to anything else, and the result is predefined: ``++false++``.
|
||||||
|
|
||||||
@ -15,7 +16,7 @@ Compare a ``++typeof++`` expression to anything else, and the result is predefin
|
|||||||
|
|
||||||
[source,javascript]
|
[source,javascript]
|
||||||
----
|
----
|
||||||
function someFunc(x: any): boolean {
|
function someFunc(x) {
|
||||||
return typeof x === "Number"; // Noncompliant, function will always return 'false'
|
return typeof x === "Number"; // Noncompliant, function will always return 'false'
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
@ -25,7 +26,7 @@ function someFunc(x: any): boolean {
|
|||||||
|
|
||||||
[source,javascript]
|
[source,javascript]
|
||||||
----
|
----
|
||||||
function someFunc(x: any): boolean {
|
function someFunc(x) {
|
||||||
return typeof x === "number";
|
return typeof x === "number";
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
Loading…
x
Reference in New Issue
Block a user