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

Unified Diff: lib/src/compiler/module_builder.dart

Issue 1979013003: fix #569, cache constants defined in methods (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: merged Created 4 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 | « lib/src/compiler/element_helpers.dart ('k') | test/browser/language_tests.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/compiler/module_builder.dart
diff --git a/lib/src/compiler/module_builder.dart b/lib/src/compiler/module_builder.dart
index 0b2be9159c0d21123dffe4184d179ea5b4f44e84..387f47a6539a30b7b1d439943bfddf3ff3f9b8dd 100644
--- a/lib/src/compiler/module_builder.dart
+++ b/lib/src/compiler/module_builder.dart
@@ -150,7 +150,11 @@ class NodeModuleBuilder extends _ModuleBuilder {
/// Escape [name] to make it into a valid identifier.
String pathToJSIdentifier(String name) {
- name = path.basenameWithoutExtension(name);
+ return toJSIdentifier(path.basenameWithoutExtension(name));
+}
+
+/// Escape [name] to make it into a valid identifier.
+String toJSIdentifier(String name) {
if (name.length == 0) return r'$';
// Escape any invalid characters
« no previous file with comments | « lib/src/compiler/element_helpers.dart ('k') | test/browser/language_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698