| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5ca836c commit 3d9e7bb
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -237,7 +237,7 @@ The `os.getNetworkInterfaces()` method is deprecated. Please use the | |||
| 237 | 237 | <a id="DEP0024"></a> | |
| 238 | 238 | ### DEP0024: REPLServer.prototype.convertToContext() | |
| 239 | 239 | ||
| 240 | - Type: Runtime | ||
| 240 | + Type: End-of-Life | ||
| 241 | 241 | ||
| 242 | 242 | The `REPLServer.prototype.convertToContext()` API is deprecated and should | |
| 243 | 243 | not be used. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1223,37 +1223,6 @@ function regexpEscape(s) { | |||
| 1223 | 1223 | return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); | |
| 1224 | 1224 | } | |
| 1225 | 1225 | ||
| 1226 | - | ||
| 1227 | - /** | ||
| 1228 | - * Converts commands that use var and function <name>() to use the | ||
| 1229 | - * local exports.context when evaled. This provides a local context | ||
| 1230 | - * on the REPL. | ||
| 1231 | - * | ||
| 1232 | - * @param {String} cmd The cmd to convert. | ||
| 1233 | - * @return {String} The converted command. | ||
| 1234 | - */ | ||
| 1235 | - // TODO(princejwesley): Remove it prior to v8.0.0 release | ||
| 1236 | - // Reference: https://github.com/nodejs/node/pull/7829 | ||
| 1237 | - REPLServer.prototype.convertToContext = util.deprecate(function(cmd) { | ||
| 1238 | - const scopeVar = /^\s*var\s*([\w$]+)(.*)$/m; | ||
| 1239 | - const scopeFunc = /^\s*function\s*([\w$]+)/; | ||
| 1240 | - var matches; | ||
| 1241 | - | ||
| 1242 | - // Replaces: var foo = "bar"; with: self.context.foo = bar; | ||
| 1243 | - matches = scopeVar.exec(cmd); | ||
| 1244 | - if (matches && matches.length === 3) { | ||
| 1245 | - return 'self.context.' + matches[1] + matches[2]; | ||
| 1246 | - } | ||
| 1247 | - | ||
| 1248 | - // Replaces: function foo() {}; with: foo = function foo() {}; | ||
| 1249 | - matches = scopeFunc.exec(this.bufferedCommand); | ||
| 1250 | - if (matches && matches.length === 2) { | ||
| 1251 | - return matches[1] + ' = ' + this.bufferedCommand; | ||
| 1252 | - } | ||
| 1253 | - | ||
| 1254 | - return cmd; | ||
| 1255 | - }, 'replServer.convertToContext() is deprecated', 'DEP0024'); | ||
| 1256 | - | ||
| 1257 | 1226 | // If the error is that we've unexpectedly ended the input, | |
| 1258 | 1227 | // then let the user try to recover by adding more input. | |
| 1259 | 1228 | function isRecoverableError(e, code) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments