From 3f27f02da04b70120b397eeee904ff92784644ac Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Mon, 27 Feb 2017 18:45:53 -0800 Subject: repl: docs-only deprecation of magic mode The workaround used in repl to support `let` and `const` in non-strict mode (known as "magic" mode) has been unnecessary since V8 v4.9 / Node.js v6.0.0. This commit doc-deprecate magic mode (which is now entirely equivalent to sloppy mode) in both `repl` module and in `internal/repl`, which is responsible for starting the REPL in `node` interactive mode. PR-URL: https://github.com/nodejs/node/pull/11599 Refs: https://v8project.blogspot.com/2016/01/v8-release-49.html Refs: https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V6.md#6.0.0 Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Prince John Wesley --- lib/internal/repl.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/internal/repl.js') diff --git a/lib/internal/repl.js b/lib/internal/repl.js index 7782d6b84b..d81f56f5c9 100644 --- a/lib/internal/repl.js +++ b/lib/internal/repl.js @@ -39,12 +39,11 @@ function createRepl(env, opts, cb) { opts.replMode = { 'strict': REPL.REPL_MODE_STRICT, - 'sloppy': REPL.REPL_MODE_SLOPPY, - 'magic': REPL.REPL_MODE_MAGIC + 'sloppy': REPL.REPL_MODE_SLOPPY }[String(env.NODE_REPL_MODE).toLowerCase().trim()]; if (opts.replMode === undefined) { - opts.replMode = REPL.REPL_MODE_MAGIC; + opts.replMode = REPL.REPL_MODE_SLOPPY; } const historySize = Number(env.NODE_REPL_HISTORY_SIZE); -- cgit v1.2.3