| OLD | NEW |
| 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 | 5 |
| 6 #import('file_system.dart'); | 6 #import('file_system.dart'); |
| 7 #import('lang.dart'); | 7 #import('lang.dart'); |
| 8 | 8 |
| 9 interface JsEvaluator { | 9 interface JsEvaluator { |
| 10 var eval(String source); | 10 var eval(String source); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 initializeWorld(files); | 21 initializeWorld(files); |
| 22 world.process(); | 22 world.process(); |
| 23 world.resolveAll(); | 23 world.resolveAll(); |
| 24 | 24 |
| 25 _marked = new Set(); | 25 _marked = new Set(); |
| 26 | 26 |
| 27 world.gen = new WorldGenerator(null, new CodeWriter()); | 27 world.gen = new WorldGenerator(null, new CodeWriter()); |
| 28 _markAllUsed(world.corelib); | 28 _markAllUsed(world.corelib); |
| 29 world.gen.writeTypes(world.coreimpl); | 29 world.gen.writeTypes(world.coreimpl); |
| 30 world.gen.writeTypes(world.corelib); | 30 world.gen.writeTypes(world.corelib); |
| 31 world.gen.writeGlobals(); |
| 31 _prelude = world.gen.writer.text; | 32 _prelude = world.gen.writer.text; |
| 32 | 33 |
| 33 // Set these here so that we can compile the corelib without its errors | 34 // Set these here so that we can compile the corelib without its errors |
| 34 // killing us | 35 // killing us |
| 35 options.throwOnErrors = true; | 36 options.throwOnErrors = true; |
| 36 options.throwOnFatal = true; | 37 options.throwOnFatal = true; |
| 37 } | 38 } |
| 38 | 39 |
| 39 // TODO(jimhug): Should be calling world.genMethod - but I'm scared to | 40 // TODO(jimhug): Should be calling world.genMethod - but I'm scared to |
| 40 // make the change myself because we don't have any test coverage here. | 41 // make the change myself because we don't have any test coverage here. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 world.gen.writeType(type); | 147 world.gen.writeType(type); |
| 147 code = world.gen.writer.text; | 148 code = world.gen.writer.text; |
| 148 } else { | 149 } else { |
| 149 parsed.visit(methGen); | 150 parsed.visit(methGen); |
| 150 code = methGen.writer.text; | 151 code = methGen.writer.text; |
| 151 } | 152 } |
| 152 | 153 |
| 153 return this._jsEvaluator.eval(code); | 154 return this._jsEvaluator.eval(code); |
| 154 } | 155 } |
| 155 } | 156 } |
| OLD | NEW |