dart-sass/test/dart_api/test_importer.dart
Natalie Weizenbaum bea609d74b
Add a top-level warn() function for functions and importers (#711)
In addition to being useful for users of Sass, this will make it
possible for core Sass functions to produce warnings without needing
an explicit reference to the evaluator.
2019-06-06 19:42:44 +01:00

19 lines
581 B
Dart

// Copyright 2017 Google Inc. Use of this source code is governed by an
// MIT-style license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
import 'package:sass/sass.dart';
/// An [Importer] whose [canonicalize] and [load] methods are provided by
/// closures.
class TestImporter extends Importer {
final Uri Function(Uri url) _canonicalize;
final ImporterResult Function(Uri url) _load;
TestImporter(this._canonicalize, this._load);
Uri canonicalize(Uri url) => _canonicalize(url);
ImporterResult load(Uri url) => _load(url);
}