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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart

Issue 22642002: 'extends Element' (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/lib/interceptors.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of js_backend; 5 part of js_backend;
6 6
7 class NativeEmitter { 7 class NativeEmitter {
8 8
9 CodeEmitterTask emitter; 9 CodeEmitterTask emitter;
10 CodeBuffer nativeBuffer; 10 CodeBuffer nativeBuffer;
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 296
297 for (ClassElement classElement in classes) { 297 for (ClassElement classElement in classes) {
298 if (classElement.isNative()) continue; 298 if (classElement.isNative()) continue;
299 ClassElement nativeAncestor = nativeAncestorOf(classElement); 299 ClassElement nativeAncestor = nativeAncestorOf(classElement);
300 if (nativeAncestor != null) { 300 if (nativeAncestor != null) {
301 map 301 map
302 .putIfAbsent(nativeAncestor, () => <ClassElement>[]) 302 .putIfAbsent(nativeAncestor, () => <ClassElement>[])
303 .add(classElement); 303 .add(classElement);
304 } 304 }
305 } 305 }
306
307 return map; 306 return map;
308 } 307 }
309 308
310 ClassBuilder generateNativeClass(ClassElement classElement) { 309 ClassBuilder generateNativeClass(ClassElement classElement) {
311 assert(!classElement.hasBackendMembers); 310 assert(!classElement.hasBackendMembers);
312 nativeClasses.add(classElement); 311 nativeClasses.add(classElement);
313 312
314 ClassElement superclass = classElement.superclass; 313 ClassElement superclass = classElement.superclass;
315 assert(superclass != null); 314 assert(superclass != null);
316 // Fix superclass. TODO(sra): make native classes inherit from Interceptor. 315 // Fix superclass. TODO(sra): make native classes inherit from Interceptor.
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 if (emitter.compiler.enableMinification) targetBuffer.add(';'); 519 if (emitter.compiler.enableMinification) targetBuffer.add(';');
521 targetBuffer.add(jsAst.prettyPrint( 520 targetBuffer.add(jsAst.prettyPrint(
522 new jsAst.ExpressionStatement(init), compiler)); 521 new jsAst.ExpressionStatement(init), compiler));
523 targetBuffer.add('\n'); 522 targetBuffer.add('\n');
524 } 523 }
525 524
526 targetBuffer.add(nativeBuffer); 525 targetBuffer.add(nativeBuffer);
527 targetBuffer.add('\n'); 526 targetBuffer.add('\n');
528 } 527 }
529 } 528 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/lib/interceptors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698