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

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: 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
« no previous file with comments | « no previous file | lib/runtime/dart/_internal.js » ('j') | lib/src/codegen/js_codegen.dart » ('J')
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 832fe838cf646f18f1f9f49e35a56b0e441fe3e6..19448e64ac860caf1e374422aeec47745850e2a2 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 | « no previous file | lib/runtime/dart/_internal.js » ('j') | lib/src/codegen/js_codegen.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698