Skip to content

Commit

Permalink
Remove CompileResult.sourceFiles
Browse files Browse the repository at this point in the history
This was never used.
  • Loading branch information
nex3 committed Jul 14, 2021
1 parent acdea51 commit 0e42a09
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 28 deletions.
7 changes: 0 additions & 7 deletions lib/src/async_compile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'dart:convert';

import 'package:path/path.dart' as p;
import 'package:source_maps/source_maps.dart';
import 'package:source_span/source_span.dart';

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

/// A map from source file URLs to the corresponding [SourceFile]s.
///
/// This can be passed to [sourceMap]'s [Mapping.spanFor] method. It's `null`
/// if source mapping was disabled for this compilation.
Map<String, SourceFile>? get sourceFiles => _serialize.sourceFiles;

/// The set that will eventually populate the JS API's
/// `result.stats.includedFiles` field.
///
Expand Down
11 changes: 0 additions & 11 deletions lib/src/util/source_map_buffer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// https://opensource.org/licenses/MIT.

import 'package:charcode/charcode.dart';
import 'package:collection/collection.dart';
import 'package:source_maps/source_maps.dart';
import 'package:source_span/source_span.dart';

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

/// A map from source file URLs to the corresponding [SourceFile]s.
///
/// This is of a form that can be passed to [Mapping.spanFor].
Map<String, SourceFile> get sourceFiles => UnmodifiableMapView({
for (var entry in _sourceFiles.entries)
entry.key.toString(): entry.value
});
final _sourceFiles = <Uri?, SourceFile>{};

/// The index of the current line in [_buffer].
var _line = 0;

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

_sourceFiles.putIfAbsent(source.sourceUrl, () => source.file);
_entries.add(Entry(source, target, null));
}

Expand Down
12 changes: 2 additions & 10 deletions lib/src/visitor/serialize.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'dart:typed_data';
import 'package:charcode/charcode.dart';
import 'package:meta/meta.dart';
import 'package:source_maps/source_maps.dart';
import 'package:source_span/source_span.dart';
import 'package:string_scanner/string_scanner.dart';

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

return SerializeResult(prefix + css,
sourceMap:
sourceMap ? visitor._buffer.buildSourceMap(prefix: prefix) : null,
sourceFiles: sourceMap ? visitor._buffer.sourceFiles : null);
sourceMap ? visitor._buffer.buildSourceMap(prefix: prefix) : null);
}

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

/// A map from source file URLs to the corresponding [SourceFile]s.
///
/// This can be passed to [sourceMap]'s [Mapping.spanFor] method. It's `null`
/// if source mapping was disabled for this compilation.
final Map<String, SourceFile>? sourceFiles;

SerializeResult(this.css, {this.sourceMap, this.sourceFiles});
SerializeResult(this.css, {this.sourceMap});
}

0 comments on commit 0e42a09

Please sign in to comment.