From 29326da2a86703585607f7507256ab91f265932f Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Tue, 7 Apr 2015 17:34:19 -0400 Subject: [PATCH] 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). --- test/language/expressions/typeof/built-in-functions.js | 8 ++++---- test/language/expressions/typeof/syntax.js | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/test/language/expressions/typeof/built-in-functions.js b/test/language/expressions/typeof/built-in-functions.js index 08b86417fd..2e0dcc2d6c 100644 --- a/test/language/expressions/typeof/built-in-functions.js +++ b/test/language/expressions/typeof/built-in-functions.js @@ -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 ); diff --git a/test/language/expressions/typeof/syntax.js b/test/language/expressions/typeof/syntax.js index 63a9f0ec29..7759998971 100644 --- a/test/language/expressions/typeof/syntax.js +++ b/test/language/expressions/typeof/syntax.js @@ -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' +);