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

Side by Side Diff: dart/lib/compiler/implementation/native_handler.dart

Issue 11184046: Clean up leg.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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
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 #library('native'); 5 library native_handler;
kasperl 2012/10/19 06:04:44 What kind of names are you going for in libraries?
ahe 2012/10/19 06:19:27 No style, just this simple rule "use the existing
6 #import('dart:uri'); 6
7 #import('leg.dart'); 7 import 'dart:uri';
8 #import('elements/elements.dart'); 8 import 'dart2jslib.dart' hide SourceString;
9 #import('js_backend/js_backend.dart'); 9 import 'elements/elements.dart';
10 #import('scanner/scannerlib.dart'); 10 import 'js_backend/js_backend.dart';
11 #import('ssa/ssa.dart'); 11 import 'scanner/scannerlib.dart';
12 #import('tree/tree.dart'); 12 import 'ssa/ssa.dart';
13 #import('util/util.dart'); 13 import 'tree/tree.dart';
14 import 'util/util.dart';
14 15
15 void processNativeClasses(Enqueuer world, 16 void processNativeClasses(Enqueuer world,
16 CodeEmitterTask emitter, 17 CodeEmitterTask emitter,
17 Collection<LibraryElement> libraries) { 18 Collection<LibraryElement> libraries) {
18 for (LibraryElement library in libraries) { 19 for (LibraryElement library in libraries) {
19 processNativeClassesInLibrary(world, emitter, library); 20 processNativeClassesInLibrary(world, emitter, library);
20 } 21 }
21 } 22 }
22 23
23 void addSubtypes(ClassElement cls, 24 void addSubtypes(ClassElement cls,
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 String parameters) { 331 String parameters) {
331 buffer.add(" if (Object.getPrototypeOf(this).hasOwnProperty"); 332 buffer.add(" if (Object.getPrototypeOf(this).hasOwnProperty");
332 buffer.add("('$methodName')) {\n"); 333 buffer.add("('$methodName')) {\n");
333 buffer.add(" $code"); 334 buffer.add(" $code");
334 buffer.add(" } else {\n"); 335 buffer.add(" } else {\n");
335 buffer.add(" return Object.prototype.$methodName.call(this"); 336 buffer.add(" return Object.prototype.$methodName.call(this");
336 buffer.add(parameters == '' ? '' : ', $parameters'); 337 buffer.add(parameters == '' ? '' : ', $parameters');
337 buffer.add(");\n"); 338 buffer.add(");\n");
338 buffer.add(" }\n"); 339 buffer.add(" }\n");
339 } 340 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698