Skip to content
Snippets Groups Projects
Commit 92a735da authored by Mike Pennisi's avatar Mike Pennisi
Browse files

Create distinct tests for arguments object types

parent 03f8ca83
No related branches found
No related tags found
No related merge requests found
......@@ -3,9 +3,11 @@
/*---
es6id: 13.6.4
description: >
Arguments objects should be able to be traversed using a `for..of` loop,
and dynamic changes to their contents should be reflected in the iterated
values.
Mapped arguments object mutation via alias during traversal using for..of
info: >
"Mapped" arguments objects should be able to be traversed using a `for..of`
loop, and dynamic changes to the formal parameters should be reflected in
the iterated values.
flags: [noStrict]
---*/
......
......@@ -2,10 +2,12 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 13.6.4
description: >
Arguments objects should be able to be traversed using a `for..of` loop,
and dynamic changes to their contents should be reflected in the iterated
values.
description: Mapped arguments object mutation during traversal using for..of
info: >
"Mapped" arguments objects should be able to be traversed using a `for..of`
loop, and dynamic changes to their contents should be reflected in the
iterated values.
flags: [noStrict]
---*/
var expected = [1, 4, 6];
......
......@@ -2,8 +2,11 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 13.6.4
description: >
Arguments objects should be able to be traversed using a `for..of` loop.
description: Mapped arguments object traversal using for..of
info: >
"Mapped" arguments objects should be able to be traversed using a `for..of`
loop.
flags: [noStrict]
---*/
var i = 0;
......
// Copyright (C) Copyright 2014 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 13.6.4
description: >
Unmapped arguments object mutation via alias during traversal using for..of
info: >
"Unmapped" arguments objects should be able to be traversed using a
`for..of` loop, and dynamic changes to the formal parameters should not be
reflected in the iterated values.
flags: [noStrict]
---*/
var expected = [1, 2, 3];
var i = 0;
(function(a, b, c) {
'use strict';
for (var value of arguments) {
a = b;
b = c;
c = i;
assert.sameValue(value, expected[i], 'argument at index ' + i);
i++;
}
}(1, 2, 3));
assert.sameValue(i, 3, 'Visits all arguments');
// Copyright (C) Copyright 2014 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 13.6.4
description: Unmapped arguments object mutation during traversal using for..of
info: >
"Unmapped" arguments objects should be able to be traversed using a
`for..of` loop, and dynamic changes to their contents should be reflected
in the iterated values.
flags: [noStrict]
---*/
var expected = [1, 4, 6];
var i = 0;
(function() {
'use strict';
for (var value of arguments) {
assert.sameValue(value, expected[i], 'argument at index ' + i);
i++;
arguments[i] *= 2;
}
}(1, 2, 3));
assert.sameValue(i, 3, 'Visits all arguments');
// Copyright (C) Copyright 2014 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 13.6.4
description: Unmapped arguments object traversal using for..of
info: >
"Umapped" arguments objects should be able to be traversed using a
`for..of` loop.
flags: [noStrict]
---*/
var i = 0;
(function() {
'use strict';
for (var value of arguments) {
assert.sameValue(value, arguments[i], 'argument at index ' + i);
i++;
}
}(0, 'a', true, false, null, undefined, NaN));
assert.sameValue(i, 7, 'Visits all arguments');
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment