Index: lib/runtime/dart/_internal.js |
diff --git a/lib/runtime/dart/_internal.js b/lib/runtime/dart/_internal.js |
index b79ef83a4f98bdb1e07b2761578847c90b801383..4823c44738fd77b7a407b20a2fda82c14df2e489 100644 |
--- a/lib/runtime/dart/_internal.js |
+++ b/lib/runtime/dart/_internal.js |
@@ -83,9 +83,8 @@ dart_library.library('dart/_internal', null, /* Imports */[ |
} |
return false; |
} |
- firstWhere(test, opts) { |
+ 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, [])); |
let length = this.length; |
for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull(i) + 1) { |
@@ -100,9 +99,8 @@ dart_library.library('dart/_internal', null, /* Imports */[ |
return orElse(); |
dart.throw(IterableElementError.noElement()); |
} |
- lastWhere(test, opts) { |
+ 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, [])); |
let length = this.length; |
for (let i = dart.notNull(length) - 1; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) { |
@@ -218,8 +216,7 @@ dart_library.library('dart/_internal', null, /* Imports */[ |
dart.as(test, dart.functionType(core.bool, [E])); |
return super.takeWhile(test); |
} |
- toList(opts) { |
- let growable = opts && 'growable' in opts ? opts.growable : true; |
+ toList({growable = true} = {}) { |
let result = null; |
if (dart.notNull(growable)) { |
result = core.List$(E).new(); |
@@ -357,8 +354,7 @@ dart_library.library('dart/_internal', null, /* Imports */[ |
return new (SubListIterable$(E))(this[_iterable], this[_start], newEnd); |
} |
} |
- toList(opts) { |
- let growable = opts && 'growable' in opts ? opts.growable : true; |
+ toList({growable = true} = {}) { |
let start = this[_start]; |
let end = this[_iterable][dartx.length]; |
if (this[_endOrLength] != null && dart.notNull(this[_endOrLength]) < dart.notNull(end)) |
@@ -972,25 +968,22 @@ dart_library.library('dart/_internal', null, /* Imports */[ |
dart.as(test, dart.functionType(core.bool, [E])); |
return false; |
} |
- firstWhere(test, opts) { |
+ 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, [])); |
if (orElse != null) |
return orElse(); |
dart.throw(IterableElementError.noElement()); |
} |
- lastWhere(test, opts) { |
+ 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, [])); |
if (orElse != null) |
return orElse(); |
dart.throw(IterableElementError.noElement()); |
} |
- singleWhere(test, opts) { |
+ singleWhere(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, [])); |
if (orElse != null) |
return orElse(); |
@@ -1033,8 +1026,7 @@ dart_library.library('dart/_internal', null, /* Imports */[ |
dart.as(test, dart.functionType(core.bool, [E])); |
return this; |
} |
- toList(opts) { |
- let growable = opts && 'growable' in opts ? opts.growable : true; |
+ toList({growable = true} = {}) { |
return dart.notNull(growable) ? dart.list([], E) : core.List$(E).new(0); |
} |
toSet() { |