Skip to content

Commit 0e42a09

Browse files
committed
Remove CompileResult.sourceFiles
This was never used.
1 parent acdea51 commit 0e42a09

File tree

3 files changed

+2
-28
lines changed

3 files changed

+2
-28
lines changed

lib/src/async_compile.dart

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import 'dart:convert';
66

77
import 'package:path/path.dart' as p;
88
import 'package:source_maps/source_maps.dart';
9-
import 'package:source_span/source_span.dart';
109

1110
import 'ast/sass.dart';
1211
import 'async_import_cache.dart';
@@ -190,12 +189,6 @@ class CompileResult {
190189
/// This is `null` if source mapping was disabled for this compilation.
191190
SingleMapping? get sourceMap => _serialize.sourceMap;
192191

193-
/// A map from source file URLs to the corresponding [SourceFile]s.
194-
///
195-
/// This can be passed to [sourceMap]'s [Mapping.spanFor] method. It's `null`
196-
/// if source mapping was disabled for this compilation.
197-
Map<String, SourceFile>? get sourceFiles => _serialize.sourceFiles;
198-
199192
/// The set that will eventually populate the JS API's
200193
/// `result.stats.includedFiles` field.
201194
///

lib/src/util/source_map_buffer.dart

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// https://opensource.org/licenses/MIT.
44

55
import 'package:charcode/charcode.dart';
6-
import 'package:collection/collection.dart';
76
import 'package:source_maps/source_maps.dart';
87
import 'package:source_span/source_span.dart';
98

@@ -17,15 +16,6 @@ class SourceMapBuffer implements StringBuffer {
1716
/// The source map entries that map the source files to [_buffer].
1817
final _entries = <Entry>[];
1918

20-
/// A map from source file URLs to the corresponding [SourceFile]s.
21-
///
22-
/// This is of a form that can be passed to [Mapping.spanFor].
23-
Map<String, SourceFile> get sourceFiles => UnmodifiableMapView({
24-
for (var entry in _sourceFiles.entries)
25-
entry.key.toString(): entry.value
26-
});
27-
final _sourceFiles = <Uri?, SourceFile>{};
28-
2919
/// The index of the current line in [_buffer].
3020
var _line = 0;
3121

@@ -84,7 +74,6 @@ class SourceMapBuffer implements StringBuffer {
8474
if (entry.target.offset == target.offset) return;
8575
}
8676

87-
_sourceFiles.putIfAbsent(source.sourceUrl, () => source.file);
8877
_entries.add(Entry(source, target, null));
8978
}
9079

lib/src/visitor/serialize.dart

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import 'dart:typed_data';
88
import 'package:charcode/charcode.dart';
99
import 'package:meta/meta.dart';
1010
import 'package:source_maps/source_maps.dart';
11-
import 'package:source_span/source_span.dart';
1211
import 'package:string_scanner/string_scanner.dart';
1312

1413
import '../ast/css.dart';
@@ -73,8 +72,7 @@ SerializeResult serialize(CssNode node,
7372

7473
return SerializeResult(prefix + css,
7574
sourceMap:
76-
sourceMap ? visitor._buffer.buildSourceMap(prefix: prefix) : null,
77-
sourceFiles: sourceMap ? visitor._buffer.sourceFiles : null);
75+
sourceMap ? visitor._buffer.buildSourceMap(prefix: prefix) : null);
7876
}
7977

8078
/// Converts [value] to a CSS string.
@@ -1317,11 +1315,5 @@ class SerializeResult {
13171315
/// This is `null` if source mapping was disabled for this compilation.
13181316
final SingleMapping? sourceMap;
13191317

1320-
/// A map from source file URLs to the corresponding [SourceFile]s.
1321-
///
1322-
/// This can be passed to [sourceMap]'s [Mapping.spanFor] method. It's `null`
1323-
/// if source mapping was disabled for this compilation.
1324-
final Map<String, SourceFile>? sourceFiles;
1325-
1326-
SerializeResult(this.css, {this.sourceMap, this.sourceFiles});
1318+
SerializeResult(this.css, {this.sourceMap});
13271319
}

0 commit comments

Comments
 (0)