Skip to content

Commit ceca8d5

Browse files
committed
[Tests] avoid relying on implicit toStrings
1 parent be106fd commit ceca8d5

File tree

14 files changed

+14
-14
lines changed

14 files changed

+14
-14
lines changed

example/array.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test('array', function (t) {
2525
[[ 1, 2, [3, 4]], [5, 6]]
2626
];
2727

28-
Function(['fn', 'g'], output)(
28+
Function('fn', 'g', String(output))(
2929
function (xs) {
3030
t.same(arrays.shift(), xs);
3131
return xs;

example/fail.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test('array', function (t) {
2525
[ [ 1, 2, [ 3, 4 ] ], [ 5, 6 ] ]
2626
];
2727

28-
Function(['fn', 'g'], output)(
28+
Function('fn', 'g', String(output))(
2929
function (xs) {
3030
t.same(arrays.shift(), xs);
3131
return xs;

example/nested.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ test('nested array test', function (t) {
3434
[[1, 2, [3, 4]], [5, 6]]
3535
];
3636

37-
Function(['fn', 'g'], output)(
37+
Function('fn', 'g', String(output))(
3838
function (xs) {
3939
t.same(arrays.shift(), xs);
4040
return xs;

example/nested_fail.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ test('nested array test', function (t) {
3434
[ [ 1, 2, [ 3, 4 ] ], [ 5, 6 ] ]
3535
];
3636

37-
Function(['fn', 'g'], output)(
37+
Function('fn', 'g', String(output))(
3838
function (xs) {
3939
t.same(arrays.shift(), xs);
4040
return xs;

example/not_enough_fail.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test('array', function (t) {
2525
[[1, 2, [3, 4]], [5, 6]]
2626
];
2727

28-
Function(['fn', 'g'], output)(
28+
Function('fn', 'g', String(output))(
2929
function (xs) {
3030
t.same(arrays.shift(), xs);
3131
return xs;

example/too_many_fail.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test('array', function (t) {
2525
[[1, 2, [3, 4]], [5, 6]]
2626
];
2727

28-
Function(['fn', 'g'], output)(
28+
Function('fn', 'g', String(output))(
2929
function (xs) {
3030
t.same(arrays.shift(), xs);
3131
return xs;

test/array.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ tap.test('array test', function (tt) {
5050
[[1, 2, [3, 4]], [5, 6]]
5151
];
5252

53-
Function(['fn', 'g'], output)(
53+
Function('fn', 'g', String(output))(
5454
function (xs) {
5555
t.same(arrays.shift(), xs);
5656
return xs;

test/exit/fail.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test('array', function (t) {
2525
[[1, 2, [3, 4]], [5, 6]]
2626
];
2727

28-
Function(['fn', 'g'], output)(
28+
Function('fn', 'g', String(output))(
2929
function (xs) {
3030
t.same(arrays.shift(), xs);
3131
return xs;

test/exit/ok.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ test('array', function (t) {
2626
[[1, 2, [3, 4]], [5, 6]]
2727
];
2828

29-
Function(['fn', 'g'], output)(
29+
Function('fn', 'g', String(output))(
3030
function (xs) {
3131
t.same(arrays.shift(), xs);
3232
return xs;

test/exit/too_few.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test('array', function (t) {
2525
[[1, 2, [3, 4]], [5, 6]]
2626
];
2727

28-
Function(['fn', 'g'], output)(
28+
Function('fn', 'g', String(output))(
2929
function (xs) {
3030
t.same(arrays.shift(), xs);
3131
return xs;

0 commit comments

Comments
 (0)