diff --git a/lib/src/callable.dart b/lib/src/callable.dart index 1ab2d516..6b1d31c1 100644 --- a/lib/src/callable.dart +++ b/lib/src/callable.dart @@ -17,11 +17,4 @@ export 'callable/user_defined.dart'; /// usable in asynchronous contexts. [Callable]s are usable with both the /// synchronous and asynchronous `compile()` functions, and as such should be /// used in preference to [AsyncCallable]s if possible. -abstract class Callable extends AsyncCallable { - // TODO(nweiz): I'd like to include the argument declaration on this interface - // as well, but supporting overloads for built-in callables makes that more - // difficult. Ideally, we'd define overloads as purely an implementation - // detail of functions, using a helper method. But that would need to - // duplicate a lot of the logic in _PerformVisitor, and I can't find an elegant - // way to do that. -} +abstract class Callable extends AsyncCallable {} diff --git a/lib/src/extend/extender.dart b/lib/src/extend/extender.dart index 5e3163eb..a4186c7b 100644 --- a/lib/src/extend/extender.dart +++ b/lib/src/extend/extender.dart @@ -28,8 +28,6 @@ class Extender { /// extensions. final _extensions = >{}; - // TODO: Create a custom PairList class that's more efficient. - /// A map from all simple selectors in extenders to the extensions that those /// extenders define. final _extensionsByExtender = >{}; diff --git a/lib/src/functions.dart b/lib/src/functions.dart index eae6dbe0..4b563951 100644 --- a/lib/src/functions.dart +++ b/lib/src/functions.dart @@ -225,8 +225,6 @@ final List coreFunctions = new UnmodifiableListView([ new BuiltInCallable("invert", r"$color, $weight: 50%", (arguments) { if (arguments[0] is SassNumber) { - // TODO: find some way of ensuring this is stringified using the right - // options. We may need to resort to zones. return _functionString("invert", arguments.take(1)); } diff --git a/lib/src/io/vm.dart b/lib/src/io/vm.dart index 9471170f..565b15aa 100644 --- a/lib/src/io/vm.dart +++ b/lib/src/io/vm.dart @@ -26,21 +26,16 @@ String readFile(String path) { try { return UTF8.decode(bytes); - } on FormatException { + } on FormatException catch (error) { + var decodedUntilError = + UTF8.decode(bytes.sublist(0, error.offset), allowMalformed: true); + var stringOffset = decodedUntilError.length; + if (decodedUntilError.endsWith("�")) stringOffset--; + var decoded = UTF8.decode(bytes, allowMalformed: true); var sourceFile = new SourceFile.fromString(decoded, url: p.toUri(path)); - - // TODO(nweiz): Use [FormatException.offset] instead when - // dart-lang/sdk#28293 is fixed. - for (var i = 0; i < bytes.length; i++) { - if (decoded.codeUnitAt(i) != 0xFFFD) continue; - throw new SassException( - "Invalid UTF-8.", sourceFile.location(i).pointSpan()); - } - - // This should be unreachable, but we'll rethrow the original exception just - // in case. - rethrow; + throw new SassException( + "Invalid UTF-8.", sourceFile.location(stringOffset).pointSpan()); } } diff --git a/lib/src/parse/selector.dart b/lib/src/parse/selector.dart index bc398953..8d7649d5 100644 --- a/lib/src/parse/selector.dart +++ b/lib/src/parse/selector.dart @@ -135,7 +135,6 @@ class SelectorParser extends Parser { components.add(_simpleSelector(allowParent: false)); } - // TODO: support "*E" (or talk to Chris about dropping support for hacks). return new CompoundSelector(components); } diff --git a/lib/src/parse/stylesheet.dart b/lib/src/parse/stylesheet.dart index 824f786f..ff823dab 100644 --- a/lib/src/parse/stylesheet.dart +++ b/lib/src/parse/stylesheet.dart @@ -2008,7 +2008,6 @@ abstract class StylesheetParser extends Parser { var color = colorsByName[lower]; if (color != null) { - // TODO(nweiz): Avoid copying the color in compressed mode. color = new SassColor.rgb( color.red, color.green, color.blue, color.alpha); setOriginalSpan(color, identifier.span); diff --git a/lib/src/utils.dart b/lib/src/utils.dart index d4a8433d..1617fd93 100644 --- a/lib/src/utils.dart +++ b/lib/src/utils.dart @@ -217,8 +217,6 @@ List longestCommonSubsequence(List list1, List list2, list1.length, (_) => new List(list2.length), growable: false); - // TODO(nweiz): Calling [select] here may be expensive. Can we use a memoizing - // approach to avoid calling it O(n*m) times in most cases? for (var i = 0; i < list1.length; i++) { for (var j = 0; j < list2.length; j++) { var selection = select(list1[i], list2[j]); diff --git a/lib/src/visitor/async_evaluate.dart b/lib/src/visitor/async_evaluate.dart index 13828776..bb2274e5 100644 --- a/lib/src/visitor/async_evaluate.dart +++ b/lib/src/visitor/async_evaluate.dart @@ -612,7 +612,6 @@ class _EvaluateVisitor .assertInt()); var to = _addExceptionSpan(node.to.span, () => toNumber.assertInt()); - // TODO: coerce units var direction = from > to ? -1 : 1; if (!node.isExclusive) to += direction; if (from == to) return null; diff --git a/lib/src/visitor/evaluate.dart b/lib/src/visitor/evaluate.dart index 0b51614e..fd273661 100644 --- a/lib/src/visitor/evaluate.dart +++ b/lib/src/visitor/evaluate.dart @@ -5,7 +5,7 @@ // DO NOT EDIT. This file was generated from async_evaluate.dart. // See tool/synchronize.dart for details. // -// Checksum: cdeeec2634c97638aef571043c0be1e99f22d7d5 +// Checksum: d443af264c677b3e99b5b32511898d92b9b41291 import 'dart:math' as math; @@ -607,7 +607,6 @@ class _EvaluateVisitor .assertInt()); var to = _addExceptionSpan(node.to.span, () => toNumber.assertInt()); - // TODO: coerce units var direction = from > to ? -1 : 1; if (!node.isExclusive) to += direction; if (from == to) return null; diff --git a/pubspec.yaml b/pubspec.yaml index 84518446..7c3bb5e9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -8,7 +8,7 @@ executables: dart-sass: sass environment: - sdk: '>=1.21.0 <2.0.0' + sdk: '>=1.22.0 <2.0.0' dependencies: args: "^0.13.0" diff --git a/tool/grind.dart b/tool/grind.dart index 02bb29a0..b0bec6ec 100644 --- a/tool/grind.dart +++ b/tool/grind.dart @@ -249,7 +249,8 @@ void _ensureBuild() { /// /// The [client] is used to download the corresponding Dart SDK. Future _buildPackage(http.Client client, String os, String architecture) async { - // TODO: Compile a single executable that embeds the Dart VM and the snapshot. + // TODO: Compile a single executable that embeds the Dart VM and the snapshot + // when dart-lang/sdk#27596 is fixed. var channel = _isDevSdk ? "dev" : "stable"; var url = "https://storage.googleapis.com/dart-archive/channels/$channel/" "release/$_dartVersion/sdk/dartsdk-$os-$architecture-release.zip";