Skip to content
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: preprocess only for defaultEval #9752

Closed
wants to merge 1 commit into from

Conversation

princejwesley
Copy link
Contributor

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

repl

Description of change

Code preprocessing is applicable only for default
eval function. Therefore, Moved preprocess function
invocation inside defaultEval function.

Fixes: #9743

@nodejs-github-bot nodejs-github-bot added the repl Issues and PRs related to the REPL subsystem. label Nov 22, 2016
Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM pending CI, thank you for doing this :)

})
};

const r = repl.start(options);
r.context = {foo: 'bar'};

try {
r.write('foo\n');
r.write('function f() {}\n');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I suggest that you add a comment describing why this particular input was chosen?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure 😄

@princejwesley
Copy link
Contributor Author

// Append a \n so that it will be either
// terminated, or continued onto the next expression if it's an
// unexpected end of input.
return `${cmd}\n`;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appending of the \n isn't needed for custom eval functions?
Because it was being appended before.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nunocastromartins Good point. \n was appended for most of the cases and it was done in same preprocess. I'll add \n for all cases as if eval function receives what user entered including the final enter.

CC: @Fishrock123

@Fishrock123
Copy link
Contributor

Fishrock123 commented Nov 23, 2016

Last CI wasn't so happy...?

New: https://ci.nodejs.org/job/node-test-pull-request/4971/

@princejwesley
Copy link
Contributor Author

princejwesley commented Nov 23, 2016

@princejwesley
Copy link
Contributor Author

@Fishrock123 CI is green 😄

@princejwesley
Copy link
Contributor Author

@nodejs/collaborators I'll land this tomorrow if there is no objection.

@princejwesley
Copy link
Contributor Author

@addaleax review the changes made after your approval.

@princejwesley
Copy link
Contributor Author

@nodejs/collaborators ping

Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still LGTM

(sorry, I was a bit busy here at NINA)

Code preprocessing is applicable only for default
eval function. Therefore, Moved `preprocess` function
invocation inside `defaultEval` function.

Fixes: nodejs#9743
PR-URL: nodejs#9752
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@princejwesley
Copy link
Contributor Author

princejwesley added a commit that referenced this pull request Dec 5, 2016
Code preprocessing is applicable only for default
eval function. Therefore, Moved `preprocess` function
invocation inside `defaultEval` function.

Fixes: #9743
PR-URL: #9752
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@princejwesley
Copy link
Contributor Author

Landed in 9366b8

Fishrock123 pushed a commit that referenced this pull request Dec 5, 2016
Code preprocessing is applicable only for default
eval function. Therefore, Moved `preprocess` function
invocation inside `defaultEval` function.

Fixes: #9743
PR-URL: #9752
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@Fishrock123 Fishrock123 mentioned this pull request Dec 5, 2016
2 tasks
jmdarling pushed a commit to jmdarling/node that referenced this pull request Dec 8, 2016
Code preprocessing is applicable only for default
eval function. Therefore, Moved `preprocess` function
invocation inside `defaultEval` function.

Fixes: nodejs#9743
PR-URL: nodejs#9752
Reviewed-By: Anna Henningsen <anna@addaleax.net>
MylesBorins pushed a commit that referenced this pull request Dec 20, 2016
Code preprocessing is applicable only for default
eval function. Therefore, Moved `preprocess` function
invocation inside `defaultEval` function.

Fixes: #9743
PR-URL: #9752
Reviewed-By: Anna Henningsen <anna@addaleax.net>
MylesBorins pushed a commit that referenced this pull request Dec 21, 2016
Code preprocessing is applicable only for default
eval function. Therefore, Moved `preprocess` function
invocation inside `defaultEval` function.

Fixes: #9743
PR-URL: #9752
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@MylesBorins MylesBorins mentioned this pull request Dec 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
repl Issues and PRs related to the REPL subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Node REPL preprocessing input string for custom eval functions
6 participants