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

Side by Side Diff: frog/library.dart

Issue 9233015: Make test.dart run web tests on Windows. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 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 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 bool get isDom() => this == world.dom; 56 bool get isDom() => this == world.dom;
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 // TODO(jmesserly): replace with node.js path.resolve 62 // TODO(jmesserly): replace with node.js path.resolve
63 if (filename.startsWith('/')) return filename; 63 if (filename.startsWith('/')) return filename;
64 if (filename.startsWith('file:///')) return filename; 64 if (filename.startsWith('file:///')) return filename;
65 if (filename.startsWith('http://')) return filename; 65 if (filename.startsWith('http://')) return filename;
66 if (const RegExp('[a-zA-Z]:/').hasMatch(filename) &&
Bill Hesse 2012/01/22 20:52:02 Can't we use an anchored regexp here, if (const R
Emily Fortuna 2012/01/23 18:27:41 Much nicer. Done. On 2012/01/22 20:52:02, Bill He
67 filename.startsWith(
68 (const RegExp('[a-zA-Z]:/')).stringMatch(filename))) {
69 return filename;
70 }
66 return joinPaths(sourceDir, filename); 71 return joinPaths(sourceDir, filename);
67 } 72 }
68 73
69 /** Adds an import to the library. */ 74 /** Adds an import to the library. */
70 addImport(String fullname, String prefix, SourceSpan span) { 75 addImport(String fullname, String prefix, SourceSpan span) {
71 var newLib = world.getOrAddLibrary(fullname); 76 var newLib = world.getOrAddLibrary(fullname);
72 // Special exemption in spec to ensure core is only imported once 77 // Special exemption in spec to ensure core is only imported once
73 if (newLib.isCore) return; 78 if (newLib.isCore) return;
74 imports.add(new LibraryImport(newLib, prefix, span)); 79 imports.add(new LibraryImport(newLib, prefix, span));
75 return newLib; 80 return newLib;
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 515
511 void visitFunctionDefinition(FunctionDefinition node) { 516 void visitFunctionDefinition(FunctionDefinition node) {
512 currentType.addMethod(node.name.name, node); 517 currentType.addMethod(node.name.name, node);
513 } 518 }
514 519
515 void visitFunctionTypeDefinition(FunctionTypeDefinition node) { 520 void visitFunctionTypeDefinition(FunctionTypeDefinition node) {
516 var type = library.addType(node.func.name.name, node, false); 521 var type = library.addType(node.func.name.name, node, false);
517 type.addMethod(':call', node.func); 522 type.addMethod(':call', node.func);
518 } 523 }
519 } 524 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698