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

Unified Diff: lib/runtime/dart/_interceptors.js

Issue 1484263002: Use destructuring assignments for named parameters (#180) (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years 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 | « bin/devrun.dart ('k') | lib/runtime/dart/_internal.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart/_interceptors.js
diff --git a/lib/runtime/dart/_interceptors.js b/lib/runtime/dart/_interceptors.js
index 2481a9376e227f81dce8ca9d36ae8c7172bcb44f..85e1bb2b4c2115d7d97d4ccf7d88341a71b37b6f 100644
--- a/lib/runtime/dart/_interceptors.js
+++ b/lib/runtime/dart/_interceptors.js
@@ -208,15 +208,13 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
dart.as(combine, dart.functionType(dart.dynamic, [dart.dynamic, E]));
return _internal.IterableMixinWorkaround.fold(this, initialValue, combine);
}
- [dartx.firstWhere](test, opts) {
+ [dartx.firstWhere](test, {orElse = null} = {}) {
dart.as(test, dart.functionType(core.bool, [E]));
- let orElse = opts && 'orElse' in opts ? opts.orElse : null;
dart.as(orElse, dart.functionType(E, []));
return dart.as(_internal.IterableMixinWorkaround.firstWhere(this, test, orElse), E);
}
- [dartx.lastWhere](test, opts) {
+ [dartx.lastWhere](test, {orElse = null} = {}) {
dart.as(test, dart.functionType(core.bool, [E]));
- let orElse = opts && 'orElse' in opts ? opts.orElse : null;
dart.as(orElse, dart.functionType(E, []));
return dart.as(_internal.IterableMixinWorkaround.lastWhereList(this, test, orElse), E);
}
@@ -345,8 +343,7 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
toString() {
return collection.ListBase.listToString(this);
}
- [dartx.toList](opts) {
- let growable = opts && 'growable' in opts ? opts.growable : true;
+ [dartx.toList]({growable = true} = {}) {
let list = this.slice();
if (!dart.notNull(growable))
JSArray$().markFixedList(dart.as(list, core.List));
@@ -1005,9 +1002,7 @@ dart_library.library('dart/_interceptors', null, /* Imports */[
[dartx.replaceAllMapped](from, convert) {
return this[dartx.splitMapJoin](from, {onMatch: convert});
}
- [dartx.splitMapJoin](from, opts) {
- let onMatch = opts && 'onMatch' in opts ? opts.onMatch : null;
- let onNonMatch = opts && 'onNonMatch' in opts ? opts.onNonMatch : null;
+ [dartx.splitMapJoin](from, {onMatch = null, onNonMatch = null} = {}) {
return dart.as(_js_helper.stringReplaceAllFuncUnchecked(this, from, onMatch, onNonMatch), core.String);
}
[dartx.replaceFirst](from, to, startIndex) {
« no previous file with comments | « bin/devrun.dart ('k') | lib/runtime/dart/_internal.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698