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

Unified Diff: pkg/dev_compiler/lib/src/compiler/code_generator.dart

Issue 2905223002: Cherry-picks of multiple html CLs
Patch Set: Created 3 years, 7 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
« no previous file with comments | « pkg/dev_compiler/lib/sdk/ddc_sdk.sum ('k') | pkg/dev_compiler/test/browser/language_tests.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/src/compiler/code_generator.dart
diff --git a/pkg/dev_compiler/lib/src/compiler/code_generator.dart b/pkg/dev_compiler/lib/src/compiler/code_generator.dart
index 7df66d29e2a33d9149355743fefa73b20995cab9..5a5ab9d218155293629629bcb9915d4376921318 100644
--- a/pkg/dev_compiler/lib/src/compiler/code_generator.dart
+++ b/pkg/dev_compiler/lib/src/compiler/code_generator.dart
@@ -6033,8 +6033,7 @@ String jsLibraryName(String libraryRoot, LibraryElement library) {
// E.g., "foo/bar.dart" and "foo$47bar.dart" would collide.
qualifiedPath = uri.pathSegments.skip(1).join(encodedSeparator);
} else if (isWithin(libraryRoot, uri.toFilePath())) {
- qualifiedPath = uri.path
- .substring(libraryRoot.length)
+ qualifiedPath = relative(uri.toFilePath(), from: libraryRoot)
.replaceAll(separator, encodedSeparator);
} else {
// We don't have a unique name.
@@ -6059,30 +6058,6 @@ String jsLibraryDebuggerName(String libraryRoot, LibraryElement library) {
return relative(filePath, from: libraryRoot);
}
-String jsDebuggingLibraryName(String libraryRoot, LibraryElement library) {
- var uri = library.source.uri;
- if (uri.scheme == 'dart') {
- return uri.path;
- }
- // TODO(vsm): This is not necessarily unique if '__' appears in a file name.
- var separator = '__';
- String qualifiedPath;
- if (uri.scheme == 'package') {
- // Strip the package name.
- // TODO(vsm): This is not unique if an escaped '/'appears in a filename.
- // E.g., "foo/bar.dart" and "foo$47bar.dart" would collide.
- qualifiedPath = uri.pathSegments.skip(1).join(separator);
- } else if (uri.toFilePath().startsWith(libraryRoot)) {
- qualifiedPath =
- uri.path.substring(libraryRoot.length).replaceAll('/', separator);
- } else {
- // We don't have a unique name.
- throw 'Invalid library root. $libraryRoot does not contain ${uri
- .toFilePath()}';
- }
- return pathToJSIdentifier(qualifiedPath);
-}
-
/// Shorthand for identifier-like property names.
/// For now, we emit them as strings and the printer restores them to
/// identifiers if it can.
« no previous file with comments | « pkg/dev_compiler/lib/sdk/ddc_sdk.sum ('k') | pkg/dev_compiler/test/browser/language_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698