Merge pull request #201 from sass/todos

Remove TODOs
This commit is contained in:
Natalie Weizenbaum 2017-12-02 16:38:11 -08:00 committed by GitHub
commit 9483c47047
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 13 additions and 34 deletions

View File

@ -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 {}

View File

@ -28,8 +28,6 @@ class Extender {
/// extensions.
final _extensions = <SimpleSelector, Map<ComplexSelector, Extension>>{};
// 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 = <SimpleSelector, List<Extension>>{};

View File

@ -225,8 +225,6 @@ final List<BuiltInCallable> 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));
}

View File

@ -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("<EFBFBD>")) 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());
}
}

View File

@ -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);
}

View File

@ -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);

View File

@ -217,8 +217,6 @@ List<T> longestCommonSubsequence<T>(List<T> list1, List<T> list2,
list1.length, (_) => new List<T>(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]);

View File

@ -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;

View File

@ -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;

View File

@ -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"

View File

@ -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";