diff options
author | Timothy Gu <timothygu99@gmail.com> | 2017-02-27 18:45:53 -0800 |
---|---|---|
committer | Timothy Gu <timothygu99@gmail.com> | 2017-03-06 19:23:34 -0800 |
commit | 3f27f02da04b70120b397eeee904ff92784644ac (patch) | |
tree | c3b683fd01fe4d801a7bb3300c676f15b59cb9ed /lib/internal/repl.js | |
parent | b77c89022b5eaa8204e7957ea49290cd0ed6aac2 (diff) | |
download | android-node-v8-3f27f02da04b70120b397eeee904ff92784644ac.tar.gz android-node-v8-3f27f02da04b70120b397eeee904ff92784644ac.tar.bz2 android-node-v8-3f27f02da04b70120b397eeee904ff92784644ac.zip |
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 <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Diffstat (limited to 'lib/internal/repl.js')
-rw-r--r-- | lib/internal/repl.js | 5 |
1 files changed, 2 insertions, 3 deletions
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); |