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 #import('../lib/node/node.dart'); | 5 #import('../../frog/lib/node/node.dart'); |
6 #import('../file_system_node.dart'); | 6 #import('../../frog/file_system_node.dart'); |
7 #import('../lang.dart'); | 7 #import('../../frog/lang.dart'); |
8 | 8 |
9 String compileDart(String basename, String filename) { | 9 String compileDart(String basename, String filename) { |
10 final basedir = path.dirname(basename); | 10 final basedir = path.dirname(basename); |
11 final fullname = '$basedir/$filename'; | 11 final fullname = '$basedir/$filename'; |
12 | 12 |
13 world.reset(); | 13 world.reset(); |
14 options.dartScript = fullname; | 14 options.dartScript = fullname; |
15 if (world.compile()) { | 15 if (world.compile()) { |
16 return world.getGeneratedCode(); | 16 return world.getGeneratedCode(); |
17 } else { | 17 } else { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 res.end(dirToHtml(req.url, filename)); | 100 res.end(dirToHtml(req.url, filename)); |
101 } | 101 } |
102 } | 102 } |
103 | 103 |
104 | 104 |
105 res.statusCode = 404; | 105 res.statusCode = 404; |
106 res.end(''); | 106 res.end(''); |
107 }).listen(1337, "localhost"); | 107 }).listen(1337, "localhost"); |
108 print('Server running at http://localhost:1337/'); | 108 print('Server running at http://localhost:1337/'); |
109 } | 109 } |
OLD | NEW |