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

Side by Side Diff: frog/library.dart

Issue 10264021: Fix codegen and isolate issues for frog dart:html (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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 | « frog/gen.dart ('k') | frog/member.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 class LibraryImport { 5 class LibraryImport {
6 final String prefix; 6 final String prefix;
7 final Library library; 7 final Library library;
8 final SourceSpan span; 8 final SourceSpan span;
9 LibraryImport(this.library, [this.prefix, this.span]); 9 LibraryImport(this.library, [this.prefix, this.span]);
10 } 10 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 Element get enclosingElement() => null; 47 Element get enclosingElement() => null;
48 Library get library() => this; 48 Library get library() => this;
49 49
50 bool get isNative() => topType.isNative; 50 bool get isNative() => topType.isNative;
51 51
52 bool get isCore() => this == world.corelib; 52 bool get isCore() => this == world.corelib;
53 bool get isCoreImpl() => this == world.coreimpl; 53 bool get isCoreImpl() => this == world.coreimpl;
54 54
55 // TODO(jmesserly): we shouldn't be special casing DOM anywhere. 55 // TODO(jmesserly): we shouldn't be special casing DOM anywhere.
56 bool get isDom() => this == world.dom; 56 bool get isDomOrHtml() => this == world.dom || this == world.html;
57 57
58 SourceSpan get span() => new SourceSpan(baseSource, 0, 0); 58 SourceSpan get span() => new SourceSpan(baseSource, 0, 0);
59 59
60 String makeFullPath(String filename) { 60 String makeFullPath(String filename) {
61 if (filename.startsWith('dart:')) return filename; 61 if (filename.startsWith('dart:')) return filename;
62 if (filename.startsWith('package:')) return filename; 62 if (filename.startsWith('package:')) return filename;
63 // TODO(jmesserly): replace with node.js path.resolve 63 // TODO(jmesserly): replace with node.js path.resolve
64 if (filename.startsWith('/')) return filename; 64 if (filename.startsWith('/')) return filename;
65 if (filename.startsWith('file:///')) return filename; 65 if (filename.startsWith('file:///')) return filename;
66 if (filename.startsWith('http://')) return filename; 66 if (filename.startsWith('http://')) return filename;
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 world.error('directives not allowed in sourced file', node.span); 365 world.error('directives not allowed in sourced file', node.span);
366 return; 366 return;
367 } 367 }
368 368
369 var name; 369 var name;
370 switch (node.name.name) { 370 switch (node.name.name) {
371 case "library": 371 case "library":
372 name = getSingleStringArg(node); 372 name = getSingleStringArg(node);
373 if (library.name == null) { 373 if (library.name == null) {
374 library.name = name; 374 library.name = name;
375 // TODO(jimhug): Hack to get native fields for io and dom - generalize .
376 if (name == 'node' || name == 'dom') {
377 library.topType.isNative = true;
378 }
379 if (seenImport || seenSource || seenResource) { 375 if (seenImport || seenSource || seenResource) {
380 world.error('#library must be first directive in file', node.span); 376 world.error('#library must be first directive in file', node.span);
381 } 377 }
382 } else { 378 } else {
383 world.error('already specified library name', node.span); 379 world.error('already specified library name', node.span);
384 } 380 }
385 break; 381 break;
386 382
387 case "import": 383 case "import":
388 seenImport = true; 384 seenImport = true;
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 500
505 void visitFunctionDefinition(FunctionDefinition node) { 501 void visitFunctionDefinition(FunctionDefinition node) {
506 currentType.addMethod(node.name.name, node); 502 currentType.addMethod(node.name.name, node);
507 } 503 }
508 504
509 void visitFunctionTypeDefinition(FunctionTypeDefinition node) { 505 void visitFunctionTypeDefinition(FunctionTypeDefinition node) {
510 var type = library.addType(node.func.name.name, node, false); 506 var type = library.addType(node.func.name.name, node, false);
511 type.addMethod(':call', node.func); 507 type.addMethod(':call', node.func);
512 } 508 }
513 } 509 }
OLDNEW
« no previous file with comments | « frog/gen.dart ('k') | frog/member.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698