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

Unified Diff: lib/compiler/implementation/native_handler.dart

Issue 10832203: Refactor Library/CompilationUnit and how we define local Scope. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Last test fixes, passes co19. Created 8 years, 4 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: lib/compiler/implementation/native_handler.dart
diff --git a/lib/compiler/implementation/native_handler.dart b/lib/compiler/implementation/native_handler.dart
index 8592b03be9d7b0cb08543242e23b7caa2ba2229d..4e101d693c756c5e7a8446c288ea68c16fd75675 100644
--- a/lib/compiler/implementation/native_handler.dart
+++ b/lib/compiler/implementation/native_handler.dart
@@ -39,7 +39,7 @@ void processNativeClassesInLibrary(Enqueuer world,
LibraryElement library) {
bool hasNativeClass = false;
final compiler = emitter.compiler;
- for (Link<Element> link = library.topLevelElements;
+ for (Link<Element> link = library.localMembers;
!link.isEmpty(); link = link.tail) {
Element element = link.head;
if (element.kind == ElementKind.CLASS) {
@@ -76,14 +76,15 @@ void maybeEnableNative(Compiler compiler,
LibraryElement library,
Uri uri) {
String libraryName = uri.toString();
- if (library.script.name.contains('dart/tests/compiler/dart2js_native')
+ if (library.entryCompilationUnit.script.name.contains(
+ 'dart/tests/compiler/dart2js_native')
|| libraryName == 'dart:dom_deprecated'
|| libraryName == 'dart:isolate'
|| libraryName == 'dart:html') {
library.canUseNative = true;
- library.define(compiler.findHelper(const SourceString('JS')), compiler);
+ library.addToScope(compiler.findHelper(const SourceString('JS')), compiler);
if (compiler.jsIndexingBehaviorInterface !== null) {
- library.define(compiler.jsIndexingBehaviorInterface, compiler);
+ library.addToScope(compiler.jsIndexingBehaviorInterface, compiler);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698