From 23912244771d3b7b4875d92d91e8257f9b4ec169 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Tue, 3 Jun 2014 23:47:22 -0400 Subject: [PATCH] Warning tests no longer fail in pre-ES5 env emulation Strict mode fails on `typeof` for undefined variables, which was used outside of strict mode for exactly the purpose of checking for undefined variables! This check will work in either case. --- test/WarnHandlersTest.js | 2 +- test/WarnTest.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/WarnHandlersTest.js b/test/WarnHandlersTest.js index ea0b09a..c2753c0 100644 --- a/test/WarnHandlersTest.js +++ b/test/WarnHandlersTest.js @@ -19,7 +19,7 @@ * along with this program. If not, see . */ -if ( typeof console === 'undefined' ) console = undefined; +try { void console } catch ( e ) { console = undefined; } require( 'common' ).testCase( { diff --git a/test/WarnTest.js b/test/WarnTest.js index 973381c..7206155 100644 --- a/test/WarnTest.js +++ b/test/WarnTest.js @@ -19,7 +19,7 @@ * along with this program. If not, see . */ -if ( typeof console === 'undefined' ) console = undefined; +try { void console } catch ( e ) { console = undefined; } require( 'common' ).testCase( {