|
535 | 535 | module.paths = Module._nodeModulePaths(cwd);
|
536 | 536 | var script = process._eval;
|
537 | 537 | var body = script;
|
538 |
| - script = 'global.__filename = ' + JSON.stringify(name) + ';\n' + |
| 538 | + script = `global.__filename = ${JSON.stringify(name)};\n` + |
539 | 539 | 'global.exports = exports;\n' +
|
540 | 540 | 'global.module = module;\n' +
|
541 | 541 | 'global.__dirname = __dirname;\n' +
|
542 | 542 | 'global.require = require;\n' +
|
543 | 543 | 'return require("vm").runInThisContext(' +
|
544 |
| - JSON.stringify(body) + ', { filename: ' + |
545 |
| - JSON.stringify(name) + ' });\n'; |
| 544 | + `${JSON.stringify(body)}, { filename: ` + |
| 545 | + `${JSON.stringify(name)} });\n`; |
546 | 546 | // Defer evaluation for a tick. This is a workaround for deferred
|
547 | 547 | // events not firing when evaluating scripts from the command line,
|
548 | 548 | // see https://github.com/nodejs/node/issues/1600.
|
549 | 549 | process.nextTick(function() {
|
550 |
| - var result = module._compile(script, name + '-wrapper'); |
| 550 | + var result = module._compile(script, `${name}-wrapper`); |
551 | 551 | if (process._print_eval) console.log(result);
|
552 | 552 | });
|
553 | 553 | }
|
|
739 | 739 | sig.slice(0, 3) === 'SIG') {
|
740 | 740 | err = process._kill(pid, startup.lazyConstants()[sig]);
|
741 | 741 | } else {
|
742 |
| - throw new Error('Unknown signal: ' + sig); |
| 742 | + throw new Error(`Unknown signal: ${sig}`); |
743 | 743 | }
|
744 | 744 | }
|
745 | 745 |
|
|
844 | 844 | }
|
845 | 845 |
|
846 | 846 | function NativeModule(id) {
|
847 |
| - this.filename = id + '.js'; |
| 847 | + this.filename = `${id}.js`; |
848 | 848 | this.id = id;
|
849 | 849 | this.exports = {};
|
850 | 850 | this.loaded = false;
|
|
864 | 864 | }
|
865 | 865 |
|
866 | 866 | if (!NativeModule.exists(id)) {
|
867 |
| - throw new Error('No such native module ' + id); |
| 867 | + throw new Error(`No such native module ${id}`); |
868 | 868 | }
|
869 | 869 |
|
870 |
| - process.moduleLoadList.push('NativeModule ' + id); |
| 870 | + process.moduleLoadList.push(`NativeModule ${id}`); |
871 | 871 |
|
872 | 872 | var nativeModule = new NativeModule(id);
|
873 | 873 |
|
|
0 commit comments