repl: remove workaround for function redefinition
The issue is fixed upstream in V8. Thus we do not need this workaround in REPL. Fixes: https://github.com/nodejs/node/issues/548 PR-URL: https://github.com/nodejs/node/pull/9618 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
parent
c2c6ae52ea
commit
007386ee81
@ -254,12 +254,6 @@ function REPLServer(prompt,
|
|||||||
// an expression.
|
// an expression.
|
||||||
cmd = `(${cmd})`;
|
cmd = `(${cmd})`;
|
||||||
self.wrappedCmd = true;
|
self.wrappedCmd = true;
|
||||||
} else {
|
|
||||||
// Mitigate https://github.com/nodejs/node/issues/548
|
|
||||||
cmd = cmd.replace(
|
|
||||||
/^\s*function(?:\s*(\*)\s*|\s+)([^(]+)/,
|
|
||||||
(_, genStar, name) => `var ${name} = function ${genStar || ''}${name}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
// Append a \n so that it will be either
|
// Append a \n so that it will be either
|
||||||
// terminated, or continued onto the next expression if it's an
|
// terminated, or continued onto the next expression if it's an
|
||||||
|
Loading…
x
Reference in New Issue
Block a user