diff --git a/src/ast/conditions.js b/src/ast/conditions.js index e454891..b21e4d4 100644 --- a/src/ast/conditions.js +++ b/src/ast/conditions.js @@ -14,7 +14,6 @@ function not ( value ) { function equals ( a, b, strict ) { if ( a.type !== b.type ) return undefined; - if ( a.type === 'Identifier' ) return a.name === b.name && a.name !== 'NaN'; if ( a.type === 'Literal' ) return strict ? a.value === b.value : a.value == b.value; } diff --git a/test/function/skips-dead-branches-f/_config.js b/test/function/skips-dead-branches-f/_config.js index e43c622..428bd69 100644 --- a/test/function/skips-dead-branches-f/_config.js +++ b/test/function/skips-dead-branches-f/_config.js @@ -1,7 +1,7 @@ var assert = require( 'assert' ); module.exports = { - description: 'skips a dead branch (f)', + description: 'skips a dead branch (g)', code: function ( code ) { assert.equal( code.indexOf( 'obj.foo = function' ), -1, code ); } diff --git a/test/function/skips-dead-branches-f/main.js b/test/function/skips-dead-branches-f/main.js index ab95b46..d53efc8 100644 --- a/test/function/skips-dead-branches-f/main.js +++ b/test/function/skips-dead-branches-f/main.js @@ -7,5 +7,5 @@ function bar () { console.log( 'this should be included' ); } -if ( NaN === NaN ) obj.foo(); +if ( 42 != '42' ) obj.foo(); bar(); diff --git a/test/function/skips-dead-branches-g/_config.js b/test/function/skips-dead-branches-g/_config.js deleted file mode 100644 index 428bd69..0000000 --- a/test/function/skips-dead-branches-g/_config.js +++ /dev/null @@ -1,8 +0,0 @@ -var assert = require( 'assert' ); - -module.exports = { - description: 'skips a dead branch (g)', - code: function ( code ) { - assert.equal( code.indexOf( 'obj.foo = function' ), -1, code ); - } -} diff --git a/test/function/skips-dead-branches-g/main.js b/test/function/skips-dead-branches-g/main.js deleted file mode 100644 index d53efc8..0000000 --- a/test/function/skips-dead-branches-g/main.js +++ /dev/null @@ -1,11 +0,0 @@ -var obj = {}; -obj.foo = function () { - console.log( 'this should be excluded' ); -} - -function bar () { - console.log( 'this should be included' ); -} - -if ( 42 != '42' ) obj.foo(); -bar();