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

Unified Diff: test/codegen/expect/collection/algorithms.js

Issue 1484263002: Use destructuring assignments for named parameters (#180) (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Destructure function params directly (no more opts in most cases) Created 5 years, 1 month 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
Index: test/codegen/expect/collection/algorithms.js
diff --git a/test/codegen/expect/collection/algorithms.js b/test/codegen/expect/collection/algorithms.js
index 7996c7a1b42e6cee7ae1c083d44e6d62e3f2967d..994a892b3b1749747074f96eef71f41f0daa8e2e 100644
--- a/test/codegen/expect/collection/algorithms.js
+++ b/test/codegen/expect/collection/algorithms.js
@@ -24,8 +24,7 @@ dart_library.library('collection/algorithms', null, /* Imports */[
return -1;
}
dart.fn(_comparableBinarySearch, core.int, [core.List$(core.Comparable), core.Comparable]);
- function binarySearch(sortedList, key, opts) {
- let compare = opts && 'compare' in opts ? opts.compare : null;
+ function binarySearch(sortedList, key, {compare = null} = {}) {
if (compare == null) {
return _comparableBinarySearch(dart.as(sortedList, core.List$(core.Comparable)), dart.as(key, core.Comparable));
}
@@ -82,10 +81,7 @@ dart_library.library('collection/algorithms', null, /* Imports */[
}
}
dart.fn(_reverse, dart.void, [core.List, core.int, core.int]);
- function insertionSort(list, opts) {
- let compare = opts && 'compare' in opts ? opts.compare : null;
- let start = opts && 'start' in opts ? opts.start : 0;
- let end = opts && 'end' in opts ? opts.end : null;
+ function insertionSort(list, {compare = null, start = 0, end = null} = {}) {
if (end == null)
end = list[dartx.length];
if (compare == null)
@@ -113,10 +109,7 @@ dart_library.library('collection/algorithms', null, /* Imports */[
}
dart.fn(_insertionSort, dart.void, [core.List, dart.functionType(core.int, [dart.dynamic, dart.dynamic]), core.int, core.int, core.int]);
let _MERGE_SORT_LIMIT = 32;
- function mergeSort(list, opts) {
- let start = opts && 'start' in opts ? opts.start : 0;
- let end = opts && 'end' in opts ? opts.end : null;
- let compare = opts && 'compare' in opts ? opts.compare : null;
+ function mergeSort(list, {start = 0, end = null, compare = null} = {}) {
if (end == null)
end = list[dartx.length];
if (compare == null)

Powered by Google App Engine
This is Rietveld 408576698