babel/test/fixtures/traceur/Destructuring/NestedScopeArguments.js
2015-01-04 19:40:09 +11:00

12 lines
386 B
JavaScript

// Destructuring bind alpha-renames 'arguments'; this ensures that
// renaming doesn't rename in nested scopes.
function destructNestedScopeArguments(x) {
[(function () { return arguments[1]; })(null, x)[0]] = [42];
}
// ----------------------------------------------------------------------------
var result = [];
destructNestedScopeArguments(result);
assert.equal(42, result[0]);