|
566 | 566 | module.paths = Module._nodeModulePaths(cwd);
|
567 | 567 | var script = process._eval;
|
568 | 568 | var body = script;
|
569 |
| - script = 'global.__filename = ' + JSON.stringify(name) + ';\n' + |
| 569 | + script = `global.__filename = ${JSON.stringify(name)};\n` + |
570 | 570 | 'global.exports = exports;\n' +
|
571 | 571 | 'global.module = module;\n' +
|
572 | 572 | 'global.__dirname = __dirname;\n' +
|
573 | 573 | 'global.require = require;\n' +
|
574 | 574 | 'return require("vm").runInThisContext(' +
|
575 |
| - JSON.stringify(body) + ', { filename: ' + |
576 |
| - JSON.stringify(name) + ', displayErrors: true });\n'; |
| 575 | + `${JSON.stringify(body)}, { filename: ` + |
| 576 | + `${JSON.stringify(name)}, displayErrors: true });\n`; |
577 | 577 | // Defer evaluation for a tick. This is a workaround for deferred
|
578 | 578 | // events not firing when evaluating scripts from the command line,
|
579 | 579 | // see https://github.com/nodejs/node/issues/1600.
|
580 | 580 | process.nextTick(function() {
|
581 |
| - var result = module._compile(script, name + '-wrapper'); |
| 581 | + var result = module._compile(script, `${name}-wrapper`); |
582 | 582 | if (process._print_eval) console.log(result);
|
583 | 583 | });
|
584 | 584 | }
|
|
770 | 770 | sig.slice(0, 3) === 'SIG') {
|
771 | 771 | err = process._kill(pid, startup.lazyConstants()[sig]);
|
772 | 772 | } else {
|
773 |
| - throw new Error('Unknown signal: ' + sig); |
| 773 | + throw new Error(`Unknown signal: ${sig}`); |
774 | 774 | }
|
775 | 775 | }
|
776 | 776 |
|
|
875 | 875 | }
|
876 | 876 |
|
877 | 877 | function NativeModule(id) {
|
878 |
| - this.filename = id + '.js'; |
| 878 | + this.filename = `${id}.js`; |
879 | 879 | this.id = id;
|
880 | 880 | this.exports = {};
|
881 | 881 | this.loaded = false;
|
|
895 | 895 | }
|
896 | 896 |
|
897 | 897 | if (!NativeModule.exists(id)) {
|
898 |
| - throw new Error('No such native module ' + id); |
| 898 | + throw new Error(`No such native module ${id}`); |
899 | 899 | }
|
900 | 900 |
|
901 |
| - process.moduleLoadList.push('NativeModule ' + id); |
| 901 | + process.moduleLoadList.push(`NativeModule ${id}`); |
902 | 902 |
|
903 | 903 | var nativeModule = new NativeModule(id);
|
904 | 904 |
|
|
0 commit comments