OLD | NEW |
| (Empty) |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | |
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. | |
4 | |
5 var fs = require('fs'); | |
6 var vm = require('vm'); | |
7 | |
8 function __load(path) { | |
9 var data = fs.readFileSync(path); | |
10 var script = vm.createScript(data.toString(), path); | |
11 script.runInThisContext(); | |
12 } | |
13 | |
14 var args = process.argv.slice(2); | |
15 var argc = args.length; | |
16 | |
17 for (var i = 0; i < argc-1; ++i) { | |
18 __load(args[i]); | |
19 } | |
20 | |
21 var main = vm.createScript(args[argc-1] + '.main()', 'main'); | |
22 main.runInThisContext(); | |
OLD | NEW |