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

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

Issue 2249233002: fix #626, add AMD module format and make it default (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: merged Created 4 years, 3 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
« no previous file with comments | « lib/js/common/dart_sdk.js ('k') | lib/js/legacy/dart_library.js » ('j') | 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) 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();
OLDNEW
« no previous file with comments | « lib/js/common/dart_sdk.js ('k') | lib/js/legacy/dart_library.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698