Skip to content
Snippets Groups Projects
Commit 29326da2 authored by Mike Pennisi's avatar Mike Pennisi
Browse files

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).
parent 3dce857e
No related branches found
No related tags found
No related merge requests found
......@@ -11,13 +11,13 @@ description: Checking types of parseInt and Math.exp
---*/
assert.sameValue(
typeof(Math.exp),
typeof Math.exp,
"function",
'#1: typeof(Math.exp)!=="function" '+typeof(Math.exp)
'#1: typeof Math.exp!=="function" '+typeof Math.exp
);
assert.sameValue(
typeof(parseInt),
typeof parseInt,
"function",
'#2: typeof(parseInt)!=="function" '+typeof(parseInt)
'#2: typeof parseInt!=="function" '+typeof parseInt
);
......@@ -69,3 +69,9 @@ assert.sameValue(
"number",
'#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'
);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment