diff --git a/src/babel/transformation/transformers/es6/tail-call.js b/src/babel/transformation/transformers/es6/tail-call.js index 3168f8ce02..78eb809380 100644 --- a/src/babel/transformation/transformers/es6/tail-call.js +++ b/src/babel/transformation/transformers/es6/tail-call.js @@ -34,12 +34,6 @@ var visitor = { return state.subTransform(node.argument); }, - ExpressionStatement(node, parent, scope, state) { - if (this.isCompletionRecord(true)) { - return state.subTransform(node.expression); - } - }, - Function() { this.skip(); }, diff --git a/test/core/fixtures/transformation/es6.tail-call/shadow/actual.js b/test/core/fixtures/transformation/es6.tail-call/shadow/actual.js index 2fa228077d..0b91223fe7 100644 --- a/test/core/fixtures/transformation/es6.tail-call/shadow/actual.js +++ b/test/core/fixtures/transformation/es6.tail-call/shadow/actual.js @@ -2,7 +2,7 @@ var foo = () => { this; arguments; - foo(); + return foo(); }; foo(); }); diff --git a/test/core/fixtures/transformation/es6.tail-call/void/actual.js b/test/core/fixtures/transformation/es6.tail-call/void/actual.js deleted file mode 100644 index 7a4a757979..0000000000 --- a/test/core/fixtures/transformation/es6.tail-call/void/actual.js +++ /dev/null @@ -1,11 +0,0 @@ -function skipWhile(cond) { - if (!hasNext() || cond(current, last)) return; - move(); - skipWhile(cond); -} - -var skipWhile2 = function (cond) { - if (!hasNext() || cond(current, last)) return; - move(); - skipWhile2(cond); -}; diff --git a/test/core/fixtures/transformation/es6.tail-call/void/expected.js b/test/core/fixtures/transformation/es6.tail-call/void/expected.js deleted file mode 100644 index 36a4e6446d..0000000000 --- a/test/core/fixtures/transformation/es6.tail-call/void/expected.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; - -function skipWhile(_x) { - var _again = true; - - _function: while (_again) { - var cond = _x; - _again = false; - - if (!hasNext() || cond(current, last)) return; - move(); - _x = cond; - _again = true; - continue _function; - } -} - -var skipWhile2 = function skipWhile2(_x2) { - var _again2 = true; - - _function2: while (_again2) { - var cond = _x2; - _again2 = false; - - if (!hasNext() || cond(current, last)) return; - move(); - _x2 = cond; - _again2 = true; - continue _function2; - } -};