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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart

Issue 179803004: Assign invalid name to globalized closures. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove debug-print and add tests. Created 6 years, 10 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 | « no previous file | sdk/lib/_internal/lib/js_mirrors.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart
index 9507f3e420a1eab579778c8bcddcb86d481f1680..7e2fdb1e74b592318277fa246dc0f083ecfb0f9e 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart
@@ -679,6 +679,12 @@ class CodeEmitterTask extends CompilerTask {
// marking the function as invokable by reflection.
return '$name=';
}
+ if (elementOrSelector is Element && elementOrSelector.isClosure()) {
+ // Closures are synthesized and their name might conflict with existing
+ // globals. Assign an illegal name, and make sure they don't clash
+ // with each other.
+ return " $mangledName";
+ }
if (elementOrSelector is Selector
|| elementOrSelector.isFunction()
|| elementOrSelector.isConstructor()) {
« no previous file with comments | « no previous file | sdk/lib/_internal/lib/js_mirrors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698