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

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: Rebase and refactor ClassElement.constructors. 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 e2fcb00a32f6c13d356fcbb60235f0290fd7e196..54e5541d1673448c37439928ccec6ca6f04b0748 100644
--- a/lib/compiler/implementation/native_handler.dart
+++ b/lib/compiler/implementation/native_handler.dart
@@ -40,7 +40,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) {
@@ -77,14 +77,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);
}
}
}
« no previous file with comments | « lib/compiler/implementation/js_backend/native_emitter.dart ('k') | lib/compiler/implementation/patch_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698