Merge branch 'master' of github.com:babel/babel
This commit is contained in:
@@ -5,9 +5,9 @@ function fact(_x2) {
|
||||
var _again = true;
|
||||
|
||||
_function: while (_again) {
|
||||
acc = undefined;
|
||||
_again = false;
|
||||
var n = _x2;
|
||||
acc = undefined;
|
||||
var acc = _arguments[1] === undefined ? 1 : _arguments[1];
|
||||
if (n > 1) {
|
||||
_arguments = [_x2 = n - 1, acc * n];
|
||||
|
||||
@@ -5,11 +5,12 @@
|
||||
var _again = true;
|
||||
|
||||
_function: while (_again) {
|
||||
m = local1 = local2 = local3 = undefined;
|
||||
|
||||
var g = function g() {};
|
||||
|
||||
_again = false;
|
||||
var n = _x2;
|
||||
m = local1 = local2 = local3 = undefined;
|
||||
var m = _arguments[1] === undefined ? getDefaultValue() : _arguments[1];
|
||||
|
||||
// `m` should be `getDefaultValue()` after first pass
|
||||
|
||||
6
test/fixtures/transformation/es6-tail-call/default-parameters/actual.js
vendored
Normal file
6
test/fixtures/transformation/es6-tail-call/default-parameters/actual.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
function sum(a=1, b=2) {
|
||||
if (b > 0) {
|
||||
return sum(a + 1, b - 1);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
20
test/fixtures/transformation/es6-tail-call/default-parameters/expected.js
vendored
Normal file
20
test/fixtures/transformation/es6-tail-call/default-parameters/expected.js
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
|
||||
function sum() {
|
||||
var _arguments = arguments;
|
||||
var _again = true;
|
||||
|
||||
_function: while (_again) {
|
||||
a = b = undefined;
|
||||
var a = _arguments[0] === undefined ? 1 : _arguments[0];
|
||||
_again = false;
|
||||
var b = _arguments[1] === undefined ? 2 : _arguments[1];
|
||||
|
||||
if (b > 0) {
|
||||
_arguments = [a + 1, b - 1];
|
||||
_again = true;
|
||||
continue _function;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user