| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2338630 commit 2f4e416
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | // Reference: https://github.com/nodejs/node/pull/7624 | |
| 2 | 2 | 'use strict'; | |
| 3 | - require('../common'); | ||
| 3 | + const common = require('../common'); | ||
| 4 | 4 | const assert = require('assert'); | |
| 5 | 5 | const repl = require('repl'); | |
| 6 | 6 | const stream = require('stream'); | |
@@ -9,7 +9,8 @@ const r = initRepl(); | |||
| 9 | 9 | ||
| 10 | 10 | r.input.emit('data', 'function a() { return 42; } (1)\n'); | |
| 11 | 11 | r.input.emit('data', 'a\n'); | |
| 12 | - r.input.emit('data', '.exit'); | ||
| 12 | + r.input.emit('data', '.exit\n'); | ||
| 13 | + r.once('exit', common.mustCall()); | ||
| 13 | 14 | ||
| 14 | 15 | const expected = '1\n[Function: a]\n'; | |
| 15 | 16 | const got = r.output.accumulator.join(''); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,5 +23,4 @@ child.on('exit', common.mustCall(() => { | |||
| 23 | 23 | })); | |
| 24 | 24 | ||
| 25 | 25 | child.stdin.write('await import(\'./message.mjs\');\n'); | |
| 26 | - child.stdin.write('.exit'); | ||
| 27 | - child.stdin.end(); | ||
| 26 | + child.stdin.write('.exit\n'); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -136,6 +136,5 @@ r4.close(); | |||
| 136 | 136 | child.stdin.write( | |
| 137 | 137 | 'assert.ok(util.inspect(repl.repl, {depth: -1}).includes("REPLServer"));\n' | |
| 138 | 138 | ); | |
| 139 | - child.stdin.write('.exit'); | ||
| 140 | - child.stdin.end(); | ||
| 139 | + child.stdin.write('.exit\n'); | ||
| 141 | 140 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,5 +20,4 @@ child.on('exit', common.mustCall(() => { | |||
| 20 | 20 | child.stdin.write('const isObject = (obj) => obj.constructor === Object;\n'); | |
| 21 | 21 | child.stdin.write('isObject({});\n'); | |
| 22 | 22 | child.stdin.write(`require(${JSON.stringify(fixture)}).isObject({});\n`); | |
| 23 | - child.stdin.write('.exit'); | ||
| 24 | - child.stdin.end(); | ||
| 23 | + child.stdin.write('.exit\n'); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,5 +23,4 @@ child.on('exit', common.mustCall(() => { | |||
| 23 | 23 | })); | |
| 24 | 24 | ||
| 25 | 25 | child.stdin.write('require("self_ref");\n'); | |
| 26 | - child.stdin.write('.exit'); | ||
| 27 | - child.stdin.end(); | ||
| 26 | + child.stdin.write('.exit\n'); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments