Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Unified Diff: test/mjsunit/harmony/destructuring.js

Issue 1278783002: [es6] Use strict arguments objects for destructured parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Doh Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/scopes.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/destructuring.js
diff --git a/test/mjsunit/harmony/destructuring.js b/test/mjsunit/harmony/destructuring.js
index 0bbaf26285932fd527cedad0c058fab591eae9e4..2a525faccbeab5ed5c3b3ccd95c23092677286f0 100644
--- a/test/mjsunit/harmony/destructuring.js
+++ b/test/mjsunit/harmony/destructuring.js
@@ -918,6 +918,27 @@
}());
+(function TestArgumentsForNonSimpleParameters() {
+ function f1({}, x) { arguments[1] = 0; return x }
+ assertEquals(6, f1({}, 6));
+ function f2({}, x) { x = 2; return arguments[1] }
+ assertEquals(7, f2({}, 7));
+ function f3(x, {}) { arguments[0] = 0; return x }
+ assertEquals(6, f3(6, {}));
+ function f4(x, {}) { x = 2; return arguments[0] }
+ assertEquals(7, f4(7, {}));
+ function f5(x, ...a) { arguments[0] = 0; return x }
+ assertEquals(6, f5(6, {}));
+ function f6(x, ...a) { x = 2; return arguments[0] }
+ assertEquals(6, f6(6, {}));
+ function f7({a: x}) { x = 2; return arguments[0].a }
+ assertEquals(5, f7({a: 5}));
+ function f8(x, ...a) { a = []; return arguments[1] }
+ assertEquals(6, f8(5, 6));
+ // TODO(caitp, rossberg): add cases for default parameters.
+}());
+
+
(function TestForInOfTDZ() {
assertThrows("'use strict'; let x = {}; for (let [x, y] of {x});", ReferenceError);
assertThrows("'use strict'; let x = {}; for (let [y, x] of {x});", ReferenceError);
« no previous file with comments | « src/scopes.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698