Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1696)

Unified Diff: pkg/polymer/lib/src/build/import_inliner.dart

Issue 421503004: Switch transformers over to source_span (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update barback deps. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/polymer/lib/src/build/import_inliner.dart
diff --git a/pkg/polymer/lib/src/build/import_inliner.dart b/pkg/polymer/lib/src/build/import_inliner.dart
index 4f838399004d766a134d944fc4314fbacefe4637..52a5456df66a55fe295f9d9ec9bf77b78433927c 100644
--- a/pkg/polymer/lib/src/build/import_inliner.dart
+++ b/pkg/polymer/lib/src/build/import_inliner.dart
@@ -17,7 +17,7 @@ import 'package:html5lib/dom.dart' show
Document, DocumentFragment, Element, Node;
import 'package:html5lib/dom_parsing.dart' show TreeVisitor;
import 'package:source_maps/refactor.dart' show TextEditTransaction;
-import 'package:source_maps/span.dart';
+import 'package:source_span/source_span.dart';
import 'common.dart';
@@ -375,7 +375,7 @@ class _UrlNormalizer extends TreeVisitor {
// Maybe it's reliable enough for finding URLs in CSS? I'm not sure.
String visitCss(String cssText) {
var url = spanUrlFor(sourceId, transform);
- var src = new SourceFile.text(url, cssText);
+ var src = new SourceFile(cssText, url: url);
return cssText.replaceAllMapped(_URL, (match) {
// Extract the URL, without any surrounding quotes.
var span = src.span(match.start, match.end);
@@ -387,7 +387,7 @@ class _UrlNormalizer extends TreeVisitor {
String visitInlineDart(String code) {
var unit = parseDirectives(code, suppressErrors: true);
- var file = new SourceFile.text(spanUrlFor(sourceId, transform), code);
+ var file = new SourceFile(code, url: spanUrlFor(sourceId, transform));
var output = new TextEditTransaction(code, file);
var foundLibraryDirective = false;
for (Directive directive in unit.directives) {
@@ -422,7 +422,7 @@ class _UrlNormalizer extends TreeVisitor {
return (output.commit()..build(file.url)).text;
}
- String _newUrl(String href, Span span) {
+ String _newUrl(String href, SourceSpan span) {
// Uri.parse blows up on invalid characters (like {{). Encoding the uri
// allows it to be parsed, which does the correct thing in the general case.
// This uri not used to build the new uri, so it never needs to be decoded.

Powered by Google App Engine
This is Rietveld 408576698