repl: add .clearhistory command #88758
Annotations
6 errors and 2 notices
|
test-linux (ubuntu-24.04-arm)
Process completed with exit code 2.
|
|
test-linux (ubuntu-24.04-arm):
test/parallel/test-repl-definecommand.mjs#L0
--- stderr ---
node:internal/modules/run_main:107
triggerUncaughtException(
^
AssertionError [ERR_ASSERTION]: The input did not match the regular expression /\n\.say1 {5}help for say1\n/. Input:
'\x1B[1G\x1B[0J> \x1B[3G.help\n' +
'.break Sometimes you get stuck, this gets you out\n' +
'.clear Break, and also clear the local context\n' +
'.editor Enter editor mode\n' +
'.exit Exit the REPL\n' +
'.help Print this help message\n' +
'.history Manage the REPL session history, e.g. `.history clear`\n' +
'.load Load JS from a file into the REPL session\n' +
'.save Save all evaluated commands in this REPL session to a file\n' +
'.say1 help for say1\n' +
'.say2\n' +
'\n' +
'Press Ctrl+C to abort current expression, Ctrl+D to exit the REPL\n' +
'\x1B[1G\x1B[0J> \x1B[3G\n' +
'\x1B[1G\x1B[0J> \x1B[3G'
at file:///home/runner/work/node/node/node/test/parallel/test-repl-definecommand.mjs:26:8 {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: '\x1B[1G\x1B[0J> \x1B[3G.help\n' +
'.break Sometimes you get stuck, this gets you out\n' +
'.clear Break, and also clear the local context\n' +
'.editor Enter editor mode\n' +
'.exit Exit the REPL\n' +
'.help Print this help message\n' +
'.history Manage the REPL session history, e.g. `.history clear`\n' +
'.load Load JS from a file into the REPL session\n' +
'.save Save all evaluated commands in this REPL session to a file\n' +
'.say1 help for say1\n' +
'.say2\n' +
'\n' +
'Press Ctrl+C to abort current expression, Ctrl+D to exit the REPL\n' +
'\x1B[1G\x1B[0J> \x1B[3G\n' +
'\x1B[1G\x1B[0J> \x1B[3G',
expected: /\n\.say1 {5}help for say1\n/,
operator: 'match',
diff: 'simple'
}
Node.js v27.0.0-pre
Command: out/Release/node /home/runner/work/node/node/node/test/parallel/test-repl-definecommand.mjs
|
|
test-linux (ubuntu-24.04-arm):
test/parallel/test-repl.js#L89
--- stderr ---
------------
out: ""
in: ""
------------
out: "message"
in: "'Read, Eval, Print Loop'"
------------
out: "invoke_me(987)"
in: "'invoked 987'"
------------
out: "a = 12345"
in: "12345"
------------
out: "{a:1}"
in: "{ a: 1 }"
------------
out: "throw new Error('test error');"
in: "Uncaught Error: test error"
in: " at REPL6:1:7"
------------
out: "throw { foo: 'bar' };"
in: "Uncaught { foo: 'bar' }"
------------
out: "function test_func() {"
in: "| "
------------
out: ".break"
in: ""
------------
out: "eval(\"function test_func() {\")"
in: "Uncaught SyntaxError: Unexpected end of input"
------------
out: "`io.js"
in: "| "
------------
out: ".break"
in: ""
------------
out: "`io.js ${\"1.0\""
in: "| "
------------
out: "+ \".2\"}`"
in: "'io.js 1.0.2'"
------------
out: "`io.js ${"
in: "| "
------------
out: "\"1.0\" + \".2\"}`"
in: "'io.js 1.0.2'"
------------
out: "(\"a\""
in: "| "
------------
out: ".charAt(0))"
in: "'a'"
------------
out: ".1234"
in: "0.1234"
------------
out: ".1+.1"
in: "0.2"
------------
out: "JSON.parse('{\"valid\": \"json\"}');"
in: "{ valid: 'json' }"
------------
out: "JSON.parse('{invalid: \\'json\\'}');"
in: "Uncaught:"
in: "SyntaxError: Expected property name or '}' in JSON at position 1 (line 1 column 2)"
------------
out: "JSON.parse('066');"
in: "Uncaught SyntaxError: Unexpected number in JSON at position 1 (line 1 column 2)"
------------
out: "JSON.parse('{');"
in: "Uncaught:"
in: "SyntaxError: Expected property name or '}' in JSON at position 1 (line 1 column 2)"
------------
out: "/(/;"
in: "Uncaught SyntaxError: Invalid regular expression: /(/: Unterminated group"
------------
out: "new RegExp(\"foo\", \"wrong modifier\");"
in: "Uncaught SyntaxError: Invalid flags supplied to RegExp constructor 'wrong modifier'"
------------
out: "(function() { \"use strict\"; return 0755; })()"
in: "Uncaught SyntaxError: Octal literals are not allowed in strict mode."
------------
out: "(function(a, a, b) { \"use strict\"; return a + b + c; })()"
in: "Uncaught SyntaxError: Duplicate parameter name not allowed in this context"
------------
out: "(function() { \"use strict\"; with (this) {} })()"
in: "Uncaught SyntaxError: Strict mode code may not include a with statement"
------------
out: "(function() { \"use strict\"; var x; delete x; })()"
in: "Uncaught SyntaxError: Delete of an unqualified identifier in strict mode."
------------
out: "(function() { \"use strict\"; eval = 17; })()"
in: "Uncaught SyntaxError: Unexpected eval or arguments in strict mode"
------------
out: "(function() { \"use strict\"; if (true) function f() { } })()"
in: "Uncaught:"
in: "SyntaxError: In strict mode code, functions can only be declared at top level or inside a block."
------------
out: "function blah() { return 1; }"
in: "undefined"
------------
out: "blah()"
in: "1"
------------
out: "var I = [1,2,3,function() {}]; I.pop()"
in: "[Function (anonymous)]"
------------
out: "{}),({}"
in: "| "
------------
out: "}"
in: "Uncaught SyntaxError: Unexpected token ')'"
------------
out: "{ a: "
in: "| "
------------
out: "1 }"
in: "{ a: 1 }"
------------
out: "{ \"a\": "
in: "| "
------------
out: "1 }"
in: "{ a: 1 }"
------------
out: "class Foo { #private = true "
in: "| "
------------
out: "num = 123456789n"
in: "| "
------------
out: "static foo = \"bar\" }"
in: "undefined"
------------
out: "(function() {"
in: "| "
------------
out: "// blah"
in: "| "
------------
out: "return 1n;"
in: "| "
------------
out: "})()"
in: "1n"
------------
out: "function f(){}; f(f(1,"
in: "| "
------------
out: "2)"
in: "| "
------------
out: ")"
in: "undefined"
------------
out: "npm install foobar"
in: "npm should be run outside of the Node.js REPL, in your normal shell."
in: "(Press Ctrl+D to exit.)"
------------
out: "let npm = () => {};"
in: "undefined"
------------
out: "npm (\n); undefined"
in: "| undefined"
------------
out: "npm [\n0]; undefined"
in: "| undefined"
------------
out: "npm +\n1; undefined"
in: "| undefined"
------------
out: "npm - \n1; undefined"
|
|
test-linux (ubuntu-24.04)
Process completed with exit code 2.
|
|
test-linux (ubuntu-24.04):
test/parallel/test-repl-definecommand.mjs#L0
--- stderr ---
node:internal/modules/run_main:107
triggerUncaughtException(
^
AssertionError [ERR_ASSERTION]: The input did not match the regular expression /\n\.say1 {5}help for say1\n/. Input:
'\x1B[1G\x1B[0J> \x1B[3G.help\n' +
'.break Sometimes you get stuck, this gets you out\n' +
'.clear Break, and also clear the local context\n' +
'.editor Enter editor mode\n' +
'.exit Exit the REPL\n' +
'.help Print this help message\n' +
'.history Manage the REPL session history, e.g. `.history clear`\n' +
'.load Load JS from a file into the REPL session\n' +
'.save Save all evaluated commands in this REPL session to a file\n' +
'.say1 help for say1\n' +
'.say2\n' +
'\n' +
'Press Ctrl+C to abort current expression, Ctrl+D to exit the REPL\n' +
'\x1B[1G\x1B[0J> \x1B[3G\n' +
'\x1B[1G\x1B[0J> \x1B[3G'
at file:///home/runner/work/node/node/node/test/parallel/test-repl-definecommand.mjs:26:8 {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: '\x1B[1G\x1B[0J> \x1B[3G.help\n' +
'.break Sometimes you get stuck, this gets you out\n' +
'.clear Break, and also clear the local context\n' +
'.editor Enter editor mode\n' +
'.exit Exit the REPL\n' +
'.help Print this help message\n' +
'.history Manage the REPL session history, e.g. `.history clear`\n' +
'.load Load JS from a file into the REPL session\n' +
'.save Save all evaluated commands in this REPL session to a file\n' +
'.say1 help for say1\n' +
'.say2\n' +
'\n' +
'Press Ctrl+C to abort current expression, Ctrl+D to exit the REPL\n' +
'\x1B[1G\x1B[0J> \x1B[3G\n' +
'\x1B[1G\x1B[0J> \x1B[3G',
expected: /\n\.say1 {5}help for say1\n/,
operator: 'match',
diff: 'simple'
}
Node.js v27.0.0-pre
Command: out/Release/node /home/runner/work/node/node/node/test/parallel/test-repl-definecommand.mjs
|
|
test-linux (ubuntu-24.04):
test/parallel/test-repl.js#L89
--- stderr ---
------------
out: ""
in: ""
------------
out: "message"
in: "'Read, Eval, Print Loop'"
------------
out: "invoke_me(987)"
in: "'invoked 987'"
------------
out: "a = 12345"
in: "12345"
------------
out: "{a:1}"
in: "{ a: 1 }"
------------
out: "throw new Error('test error');"
in: "Uncaught Error: test error"
in: " at REPL6:1:7"
------------
out: "throw { foo: 'bar' };"
in: "Uncaught { foo: 'bar' }"
------------
out: "function test_func() {"
in: "| "
------------
out: ".break"
in: ""
------------
out: "eval(\"function test_func() {\")"
in: "Uncaught SyntaxError: Unexpected end of input"
------------
out: "`io.js"
in: "| "
------------
out: ".break"
in: ""
------------
out: "`io.js ${\"1.0\""
in: "| "
------------
out: "+ \".2\"}`"
in: "'io.js 1.0.2'"
------------
out: "`io.js ${"
in: "| "
------------
out: "\"1.0\" + \".2\"}`"
in: "'io.js 1.0.2'"
------------
out: "(\"a\""
in: "| "
------------
out: ".charAt(0))"
in: "'a'"
------------
out: ".1234"
in: "0.1234"
------------
out: ".1+.1"
in: "0.2"
------------
out: "JSON.parse('{\"valid\": \"json\"}');"
in: "{ valid: 'json' }"
------------
out: "JSON.parse('{invalid: \\'json\\'}');"
in: "Uncaught:"
in: "SyntaxError: Expected property name or '}' in JSON at position 1 (line 1 column 2)"
------------
out: "JSON.parse('066');"
in: "Uncaught SyntaxError: Unexpected number in JSON at position 1 (line 1 column 2)"
------------
out: "JSON.parse('{');"
in: "Uncaught:"
in: "SyntaxError: Expected property name or '}' in JSON at position 1 (line 1 column 2)"
------------
out: "/(/;"
in: "Uncaught SyntaxError: Invalid regular expression: /(/: Unterminated group"
------------
out: "new RegExp(\"foo\", \"wrong modifier\");"
in: "Uncaught SyntaxError: Invalid flags supplied to RegExp constructor 'wrong modifier'"
------------
out: "(function() { \"use strict\"; return 0755; })()"
in: "Uncaught SyntaxError: Octal literals are not allowed in strict mode."
------------
out: "(function(a, a, b) { \"use strict\"; return a + b + c; })()"
in: "Uncaught SyntaxError: Duplicate parameter name not allowed in this context"
------------
out: "(function() { \"use strict\"; with (this) {} })()"
in: "Uncaught SyntaxError: Strict mode code may not include a with statement"
------------
out: "(function() { \"use strict\"; var x; delete x; })()"
in: "Uncaught SyntaxError: Delete of an unqualified identifier in strict mode."
------------
out: "(function() { \"use strict\"; eval = 17; })()"
in: "Uncaught SyntaxError: Unexpected eval or arguments in strict mode"
------------
out: "(function() { \"use strict\"; if (true) function f() { } })()"
in: "Uncaught:"
in: "SyntaxError: In strict mode code, functions can only be declared at top level or inside a block."
------------
out: "function blah() { return 1; }"
in: "undefined"
------------
out: "blah()"
in: "1"
------------
out: "var I = [1,2,3,function() {}]; I.pop()"
in: "[Function (anonymous)]"
------------
out: "{}),({}"
in: "| "
------------
out: "}"
in: "Uncaught SyntaxError: Unexpected token ')'"
------------
out: "{ a: "
in: "| "
------------
out: "1 }"
in: "{ a: 1 }"
------------
out: "{ \"a\": "
in: "| "
------------
out: "1 }"
in: "{ a: 1 }"
------------
out: "class Foo { #private = true "
in: "| "
------------
out: "num = 123456789n"
in: "| "
------------
out: "static foo = \"bar\" }"
in: "undefined"
------------
out: "(function() {"
in: "| "
------------
out: "// blah"
in: "| "
------------
out: "return 1n;"
in: "| "
------------
out: "})()"
in: "1n"
------------
out: "function f(){}; f(f(1,"
in: "| "
------------
out: "2)"
in: "| "
------------
out: ")"
in: "undefined"
------------
out: "npm install foobar"
in: "npm should be run outside of the Node.js REPL, in your normal shell."
in: "(Press Ctrl+D to exit.)"
------------
out: "let npm = () => {};"
in: "undefined"
------------
out: "npm (\n); undefined"
in: "| undefined"
------------
out: "npm [\n0]; undefined"
in: "| undefined"
------------
out: "npm +\n1; undefined"
in: "| undefined"
------------
out: "npm - \n1; undefined"
|
|
sccache stats - test-linux
52% - 2639 hits, 2391 misses, 0 errors
|
|
sccache stats - test-linux
58% - 2944 hits, 2097 misses, 0 errors
|