You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
samples/packages/$sdk/dev_compiler/kernel/common/run.js

23 lines
616 B

// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
var fs = require('fs');
var vm = require('vm');
function __load(path) {
var data = fs.readFileSync(path);
var script = vm.createScript(data.toString(), path);
script.runInThisContext();
}
var args = process.argv.slice(2);
var argc = args.length;
for (var i = 0; i < argc-1; ++i) {
__load(args[i]);
}
var main = vm.createScript(args[argc-1] + '.main()', 'main');
main.runInThisContext();