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

Side by Side Diff: test/mjsunit/harmony/destructuring.js

Issue 1311163002: [es6] Correct length for functions with default parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comment 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 unified diff | Download patch
« no previous file with comments | « test/mjsunit/harmony/default-parameters.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Flags: --harmony-destructuring --harmony-arrow-functions 5 // Flags: --harmony-destructuring --harmony-arrow-functions
6 // Flags: --harmony-default-parameters --harmony-rest-parameters 6 // Flags: --harmony-default-parameters --harmony-rest-parameters
7 7
8 (function TestObjectLiteralPattern() { 8 (function TestObjectLiteralPattern() {
9 var { x : x, y : y } = { x : 1, y : 2 }; 9 var { x : x, y : y } = { x : 1, y : 2 };
10 assertEquals(1, x); 10 assertEquals(1, x);
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 assertEquals(6, f8(5, 6)); 946 assertEquals(6, f8(5, 6));
947 }()); 947 }());
948 948
949 949
950 (function TestForInOfTDZ() { 950 (function TestForInOfTDZ() {
951 assertThrows("'use strict'; let x = {}; for (let [x, y] of {x});", ReferenceEr ror); 951 assertThrows("'use strict'; let x = {}; for (let [x, y] of {x});", ReferenceEr ror);
952 assertThrows("'use strict'; let x = {}; for (let [y, x] of {x});", ReferenceEr ror); 952 assertThrows("'use strict'; let x = {}; for (let [y, x] of {x});", ReferenceEr ror);
953 assertThrows("'use strict'; let x = {}; for (let [x, y] in {x});", ReferenceEr ror); 953 assertThrows("'use strict'; let x = {}; for (let [x, y] in {x});", ReferenceEr ror);
954 assertThrows("'use strict'; let x = {}; for (let [y, x] in {x});", ReferenceEr ror); 954 assertThrows("'use strict'; let x = {}; for (let [y, x] in {x});", ReferenceEr ror);
955 }()); 955 }());
956
957
958 (function TestFunctionLength() {
959 assertEquals(1, (function({}) {}).length);
960 assertEquals(1, (function([]) {}).length);
961 assertEquals(1, (function({x}) {}).length);
962 assertEquals(1, (function({}, ...a) {}).length);
963 assertEquals(1, (function({x}, {y} = {}) {}).length);
964 assertEquals(1, (function({x}, {y} = {}, ...a) {}).length);
965 assertEquals(2, (function(x, {y}, {z} = {}) {}).length);
966 assertEquals(2, (function({x}, {}, {z} = {}, ...a) {}).length);
967 assertEquals(1, (function(x, {y} = {}, {z}) {}).length);
968 assertEquals(1, (function({x}, {y} = {}, {z}, ...a) {}).length);
969 assertEquals(1, (function(x, {y} = {}, {z}, {v} = {}) {}).length);
970 assertEquals(1, (function({x}, {y} = {}, {z}, {v} = {}, ...a) {}).length);
971 })();
OLDNEW
« no previous file with comments | « test/mjsunit/harmony/default-parameters.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698