diff --git a/lib/src/callable/async.dart b/lib/src/callable/async.dart index 30a4cd9bf..00acb0c4a 100644 --- a/lib/src/callable/async.dart +++ b/lib/src/callable/async.dart @@ -4,8 +4,6 @@ import 'dart:async'; -import 'package:async/async.dart'; - import '../value.dart'; import '../value/external/value.dart' as ext; import 'async_built_in.dart'; @@ -34,6 +32,6 @@ abstract class AsyncCallable { new AsyncBuiltInCallable(name, arguments, (arguments) { var result = callback(arguments); if (result is ext.Value) return result as Value; - return DelegatingFuture.typed(result as Future); + return (result as Future).then((value) => value as Value); }); } diff --git a/lib/src/extend/functions.dart b/lib/src/extend/functions.dart index 0a956341c..60280b80b 100644 --- a/lib/src/extend/functions.dart +++ b/lib/src/extend/functions.dart @@ -789,8 +789,12 @@ bool _selectorPseudoIsSuperselector( /// and that have the given [name]. Iterable _selectorPseudosNamed( CompoundSelector compound, String name) => - DelegatingIterable.typed(compound.components.where((simple) => - simple is PseudoSelector && - simple.isClass && - simple.selector != null && - simple.name == name)); + // TODO(nweiz): Use whereType() when we only have to support Dart 2 runtime + // semantics. + compound.components + .where((pseudo) => + pseudo is PseudoSelector && + pseudo.isClass && + pseudo.selector != null && + pseudo.name == name) + .cast(); diff --git a/lib/src/node.dart b/lib/src/node.dart index c8e68c632..3f1e99f7d 100644 --- a/lib/src/node.dart +++ b/lib/src/node.dart @@ -6,7 +6,6 @@ import 'dart:async'; import 'dart:js_util'; import 'dart:typed_data'; -import 'package:collection/collection.dart'; import 'package:dart2_constant/convert.dart' as convert; import 'package:js/js.dart'; import 'package:path/path.dart' as p; @@ -134,7 +133,7 @@ RenderResult _renderSync(RenderOptions options) { if (options.data != null) { result = compileString(options.data, nodeImporter: _parseImporter(options, start), - functions: DelegatingList.typed(_parseFunctions(options)), + functions: _parseFunctions(options).cast(), indented: isTruthy(options.indentedSyntax), style: _parseOutputStyle(options.outputStyle), useSpaces: options.indentType != 'tab', @@ -145,7 +144,7 @@ RenderResult _renderSync(RenderOptions options) { } else if (options.file != null) { result = compile(file, nodeImporter: _parseImporter(options, start), - functions: DelegatingList.typed(_parseFunctions(options)), + functions: _parseFunctions(options).cast(), indented: options.indentedSyntax, style: _parseOutputStyle(options.outputStyle), useSpaces: options.indentType != 'tab', @@ -255,7 +254,7 @@ NodeImporter _parseImporter(RenderOptions options, DateTime start) { if (options.importer == null) { importers = []; } else if (options.importer is List) { - importers = DelegatingList.typed(options.importer as List); + importers = (options.importer as List).cast(); } else { importers = [options.importer as _Importer]; } diff --git a/lib/src/value/external/argument_list.dart b/lib/src/value/external/argument_list.dart index df8eb7c57..c38f7cc6d 100644 --- a/lib/src/value/external/argument_list.dart +++ b/lib/src/value/external/argument_list.dart @@ -2,8 +2,6 @@ // MIT-style license that can be found in the LICENSE file or at // https://opensource.org/licenses/MIT. -import 'package:collection/collection.dart'; - import '../../value.dart' as internal; import '../../value.dart' show ListSeparator; import 'value.dart'; @@ -21,6 +19,6 @@ abstract class SassArgumentList extends SassList { factory SassArgumentList(Iterable contents, Map keywords, ListSeparator separator) => - new internal.SassArgumentList(DelegatingIterable.typed(contents), - DelegatingMap.typed(keywords), separator); + new internal.SassArgumentList( + contents.cast(), keywords.cast(), separator); } diff --git a/lib/src/value/external/list.dart b/lib/src/value/external/list.dart index 1c6b75236..64b36874e 100644 --- a/lib/src/value/external/list.dart +++ b/lib/src/value/external/list.dart @@ -2,8 +2,6 @@ // MIT-style license that can be found in the LICENSE file or at // https://opensource.org/licenses/MIT. -import 'package:collection/collection.dart'; - import '../../value.dart' as internal; import '../../value.dart' show ListSeparator; import 'value.dart'; @@ -23,6 +21,5 @@ abstract class SassList extends Value { /// Returns an empty list with the given [separator] and [brackets]. factory SassList(Iterable contents, ListSeparator separator, {bool brackets: false}) => - new internal.SassList(DelegatingIterable.typed(contents), separator, - brackets: brackets); + new internal.SassList(contents.cast(), separator, brackets: brackets); } diff --git a/lib/src/value/external/map.dart b/lib/src/value/external/map.dart index aec5cb4c2..3fa4776aa 100644 --- a/lib/src/value/external/map.dart +++ b/lib/src/value/external/map.dart @@ -2,8 +2,6 @@ // MIT-style license that can be found in the LICENSE file or at // https://opensource.org/licenses/MIT. -import 'package:collection/collection.dart'; - import '../../value.dart' as internal; import 'value.dart'; @@ -22,5 +20,5 @@ abstract class SassMap extends Value { const factory SassMap.empty() = internal.SassMap.empty; factory SassMap(Map contents) => - new internal.SassMap(DelegatingMap.typed(contents)); + new internal.SassMap(contents.cast()); } diff --git a/tool/grind/standalone.dart b/tool/grind/standalone.dart index 5836d2b33..c38672378 100644 --- a/tool/grind/standalone.dart +++ b/tool/grind/standalone.dart @@ -68,7 +68,7 @@ Future _buildPackage(http.Client client, String os, {bool x64: true}) async { .firstWhere((file) => os == 'windows' ? file.name.endsWith("/bin/dart.exe") : file.name.endsWith("/bin/dart")); - var executable = DelegatingList.typed(dartExecutable.content as List); + var executable = dartExecutable.content as List; // Use the app snapshot when packaging for the current operating system. //