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

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

Issue 2701963002: Enable DDC output to run on v8/d8 using ES6 modules (Closed)
Patch Set: Created 3 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 | « pkg/dev_compiler/lib/sdk/ddc_sdk.sum ('k') | pkg/dev_compiler/lib/src/compiler/module_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/src/compiler/js_names.dart
diff --git a/pkg/dev_compiler/lib/src/compiler/js_names.dart b/pkg/dev_compiler/lib/src/compiler/js_names.dart
index 93da875bad0abf3e0afabdd25e2a34dae1193274..456344a6a91e904e6a92f7956947989ab867f436 100644
--- a/pkg/dev_compiler/lib/src/compiler/js_names.dart
+++ b/pkg/dev_compiler/lib/src/compiler/js_names.dart
@@ -110,6 +110,7 @@ class _FunctionScope {
class _RenameVisitor extends VariableDeclarationVisitor {
final pendingRenames = new Map<Object, Set<_FunctionScope>>();
+ final _FunctionScope globalScope = new _FunctionScope(null);
final _FunctionScope rootScope = new _FunctionScope(null);
_FunctionScope scope;
@@ -139,7 +140,7 @@ class _RenameVisitor extends VariableDeclarationVisitor {
}
if (declScope == null) {
// Assume it comes from the global scope.
- declScope = rootScope;
+ declScope = globalScope;
declScope.declared.add(id);
}
_markUsed(node, id, declScope);
@@ -149,7 +150,7 @@ class _RenameVisitor extends VariableDeclarationVisitor {
// If it needs rename, we can't add it to the used name set yet, instead we
// will record all scopes it is visible in.
Set<_FunctionScope> usedIn = null;
- var rename = declScope != rootScope && needsRename(node);
+ var rename = declScope != globalScope && needsRename(node);
if (rename) {
usedIn = pendingRenames.putIfAbsent(id, () => new HashSet());
}
« no previous file with comments | « pkg/dev_compiler/lib/sdk/ddc_sdk.sum ('k') | pkg/dev_compiler/lib/src/compiler/module_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698