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

Side by Side Diff: world.dart

Issue 8437081: Frog changes (in experimental) to get frog integrated into the test infrastructure. (Closed) Base URL: http://dart.googlecode.com/svn/experimental/frog/
Patch Set: '' Created 9 years, 1 month 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
« scripts/buildbot_annotated_steps.py ('K') | « tests/frog/testcfg.py ('k') | no next file » | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** The one true [World]. */ 5 /** The one true [World]. */
6 World world; 6 World world;
7 7
8 /** 8 /**
9 * Should be called exactly once to setup singleton world. 9 * Should be called exactly once to setup singleton world.
10 * Can use world.reset() to reinitialize. 10 * Can use world.reset() to reinitialize.
11 */ 11 */
12 void initializeWorld(FileSystem files) { 12 void initializeWorld(FileSystem files) {
13 assert(world == null); 13 assert(world == null);
14 world = new World(files); 14 world = new World(files);
15 world.init(); 15 world.init();
16 } 16 }
17 17
18 /** 18 /**
19 * Compiles the [target] dart file using the given [corelib]. 19 * Compiles the [target] dart file using the given [corelib].
20 */ 20 */
21 bool compile(String homedir, List<String> args, FileSystem files) { 21 bool compile(String homedir, List<String> args, FileSystem files) {
22 parseOptions(homedir, args); 22 parseOptions(homedir, args, files);
23 initializeWorld(files); 23 initializeWorld(files);
24 24
25 var success = world.compile(); 25 var success = world.compile();
26 if (options.outfile != null) { 26 if (options.outfile != null) {
27 if (success) { 27 if (success) {
28 var code = world.getGeneratedCode(); 28 var code = world.getGeneratedCode();
29 if (!options.outfile.endsWith('.js')) { 29 if (!options.outfile.endsWith('.js')) {
30 // Add in #! to invoke node.js on files with non-js extensions 30 // Add in #! to invoke node.js on files with non-js extensions
31 code = '#!/usr/bin/env node\n' + code; 31 code = '#!/usr/bin/env node\n' + code;
32 } 32 }
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 421
422 withTiming(String name, f()) { 422 withTiming(String name, f()) {
423 final sw = new StopWatch(); 423 final sw = new StopWatch();
424 sw.start(); 424 sw.start();
425 var result = f(); 425 var result = f();
426 sw.stop(); 426 sw.stop();
427 info('$name in ${sw.elapsedInMs()}msec'); 427 info('$name in ${sw.elapsedInMs()}msec');
428 return result; 428 return result;
429 } 429 }
430 } 430 }
OLDNEW
« scripts/buildbot_annotated_steps.py ('K') | « tests/frog/testcfg.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698