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

Side by Side Diff: lib/runtime/run.js

Issue 1002443002: minor code cleanup (Closed) Base URL: git@github.com:dart-lang/dart-dev-compiler.git@master
Patch Set: Created 5 years, 9 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 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 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 var fs = require('fs'); 5 var fs = require('fs');
6 var vm = require('vm'); 6 var vm = require('vm');
7 7
8 function __load(path) { 8 function __load(path) {
9 var data = fs.readFileSync(path); 9 var data = fs.readFileSync(path);
10 var script = vm.createScript(data.toString(), path); 10 var script = vm.createScript(data.toString(), path);
11 script.runInThisContext(); 11 script.runInThisContext();
12 } 12 }
13 13
14 var args = process.argv.slice(2); 14 var args = process.argv.slice(2);
15 var argc = args.length; 15 var argc = args.length;
16 16
17 for(var i = 0; i < argc-1; ++i) { 17 for (var i = 0; i < argc-1; ++i) {
18 __load(args[i]); 18 __load(args[i]);
19 } 19 }
20 20
21 var main = vm.createScript(args[argc-1]+'.main()', 'main'); 21 var main = vm.createScript(args[argc-1] + '.main()', 'main');
22 main.runInThisContext(); 22 main.runInThisContext();
23
24
OLDNEW
« no previous file with comments | « lib/runtime/dart_runtime.js ('k') | test/codegen/expect/server_mode/dev_compiler/runtime/dart_runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698