Provide placeholders for proper function length.

This commit is contained in:
Ingvar Stepanyan
2015-02-07 14:26:03 +02:00
parent 5b2216b348
commit b53b41cef3
8 changed files with 19 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
"use strict";
(function f() {
(function f(n) {
var _arguments = arguments,
_this = this,
_shouldContinue,

View File

@@ -1,6 +1,6 @@
"use strict";
(function f() {
(function f(n) {
var _arguments = arguments,
_this = this,
_shouldContinue,

View File

@@ -1,4 +1,4 @@
(function f(n, /* should be undefined after first pass */ m) {
(function f(n = getDefaultValue(), /* should be undefined after first pass */ m) {
if (n <= 0) {
return "foo";
}

View File

@@ -0,0 +1,9 @@
var timeLimit = Date.now() + 1000;
assert.equal((function f(n) {
assert.operator(Date.now(), '<', timeLimit, "Timeout");
if (n <= 0) {
return "foo";
}
return f(n - 1);
})(1e6), "foo");

View File

@@ -1,13 +1,14 @@
"use strict";
(function f() {
(function f(_x, /* should be undefined after first pass */m) {
var _arguments = arguments,
_this = this,
_shouldContinue,
_result;
do {
_shouldContinue = false;
_result = (function (n, /* should be undefined after first pass */m) {
_result = (function (_x, m) {
var n = arguments[0] === undefined ? getDefaultValue() : arguments[0];
if (n <= 0) {
return "foo";
}

View File

@@ -9,7 +9,7 @@
} catch (e) {}
})(1000000) === "foo";
(function f() {
(function f(n) {
var _arguments = arguments,
_this = this,
_shouldContinue,
@@ -43,7 +43,7 @@
} finally {}
})(1000000) === "foo";
(function f() {
(function f(n) {
var _arguments = arguments,
_this = this,
_shouldContinue,