mirror of
https://github.com/tc39/test262.git
synced 2025-07-26 23:44:27 +02:00
Normalize application of typeof
operator
Consistently use the `typeof` operator without the grouping operator (and include one explicit test to ensure the validity of this pattern generally).
This commit is contained in:
parent
3dce857e32
commit
29326da2a8
@ -11,13 +11,13 @@ description: Checking types of parseInt and Math.exp
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
typeof(Math.exp),
|
typeof Math.exp,
|
||||||
"function",
|
"function",
|
||||||
'#1: typeof(Math.exp)!=="function" '+typeof(Math.exp)
|
'#1: typeof Math.exp!=="function" '+typeof Math.exp
|
||||||
);
|
);
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
typeof(parseInt),
|
typeof parseInt,
|
||||||
"function",
|
"function",
|
||||||
'#2: typeof(parseInt)!=="function" '+typeof(parseInt)
|
'#2: typeof parseInt!=="function" '+typeof parseInt
|
||||||
);
|
);
|
||||||
|
@ -69,3 +69,9 @@ assert.sameValue(
|
|||||||
"number",
|
"number",
|
||||||
'#10: var x = 0; typeof\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029x; x === "number". Actual: ' + (x)
|
'#10: var x = 0; typeof\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029x; x === "number". Actual: ' + (x)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
assert.sameValue(
|
||||||
|
eval("typeof(0)"),
|
||||||
|
"number",
|
||||||
|
'applied with grouping operator enclosing operand'
|
||||||
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user