-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
REPL special commands need arg validation #52218
Labels
good first issue
Issues that are suitable for first-time contributors.
Comments
MrJithil
added
the
good first issue
Issues that are suitable for first-time contributors.
label
Mar 26, 2024
Hello @MrJithil, I am interested in working on this issue. Could you guide me on where to start? |
thomas-mauran
added a commit
to thomas-mauran/node
that referenced
this issue
Mar 26, 2024
This commit adds a proper error message using ERR_MISSING_ARGS('file') when a .save or .load REPL command is runned. This commit also adds test for both of this cases. Fixes: nodejs#52218 Signed-off-by: Thomas Mauran <thomas.mauran@etu.umontpellier.fr>
nodejs-github-bot
pushed a commit
that referenced
this issue
Apr 6, 2024
This commit adds a proper error message using ERR_MISSING_ARGS('file') when a .save or .load REPL command is runned. This commit also adds test for both of this cases. Fixes: #52218 Signed-off-by: Thomas Mauran <thomas.mauran@etu.umontpellier.fr> PR-URL: #52225 Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
marco-ippolito
pushed a commit
that referenced
this issue
May 2, 2024
This commit adds a proper error message using ERR_MISSING_ARGS('file') when a .save or .load REPL command is runned. This commit also adds test for both of this cases. Fixes: #52218 Signed-off-by: Thomas Mauran <thomas.mauran@etu.umontpellier.fr> PR-URL: #52225 Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
marco-ippolito
pushed a commit
that referenced
this issue
May 3, 2024
This commit adds a proper error message using ERR_MISSING_ARGS('file') when a .save or .load REPL command is runned. This commit also adds test for both of this cases. Fixes: #52218 Signed-off-by: Thomas Mauran <thomas.mauran@etu.umontpellier.fr> PR-URL: #52225 Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the current implementation, the REPL commands such as .save and .load accept a filePath as arguments.
It would greatly improve user experience if we could validate these arguments to prevent attempts to save or load files with empty filenames.
In case the
file
is an empty string, we should print the error message, show the prompt to the user andreturn
.ERR_MISSING_ARGS
would be a good fit here to frame the message.Eg:
const { message } = new ERR_MISSING_ARGS('file');
String values like
0
,false
,null
,undefined
etc are still a valid filenames and good to write some unit tests for this.The text was updated successfully, but these errors were encountered: