| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 58b1f33 commit 4f2bf8c
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -293,7 +293,8 @@ overrides: | |||
| 293 | 293 | - ./internal/process/*.js | |
| 294 | 294 | - ./internal/readline/*.js | |
| 295 | 295 | - ./internal/readme.md | |
| 296 | - - ./internal/repl/history.js | ||
| 296 | + - ./internal/repl.js | ||
| 297 | + - ./internal/repl/*.js | ||
| 297 | 298 | - ./internal/source_map/prepare_stack_trace.js | |
| 298 | 299 | - ./internal/streams/*.js | |
| 299 | 300 | - ./internal/structured_clone.js | |
@@ -310,6 +311,7 @@ overrides: | |||
| 310 | 311 | - ./path/*.js | |
| 311 | 312 | - ./process.js | |
| 312 | 313 | - ./punycode.js | |
| 314 | + - ./repl.js | ||
| 313 | 315 | - ./stream/*.js | |
| 314 | 316 | - ./sys.js | |
| 315 | 317 | - ./test.js | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,7 +22,7 @@ function createRepl(env, opts, cb) { | |||
| 22 | 22 | ignoreUndefined: false, | |
| 23 | 23 | useGlobal: true, | |
| 24 | 24 | breakEvalOnSigint: true, | |
| 25 | - ...opts | ||
| 25 | + ...opts, | ||
| 26 | 26 | }; | |
| 27 | 27 | ||
| 28 | 28 | if (NumberParseInt(env.NODE_NO_READLINE)) { | |
@@ -32,7 +32,7 @@ function createRepl(env, opts, cb) { | |||
| 32 | 32 | if (env.NODE_REPL_MODE) { | |
| 33 | 33 | opts.replMode = { | |
| 34 | 34 | 'strict': REPL.REPL_MODE_STRICT, | |
| 35 | - 'sloppy': REPL.REPL_MODE_SLOPPY | ||
| 35 | + 'sloppy': REPL.REPL_MODE_SLOPPY, | ||
| 36 | 36 | }[env.NODE_REPL_MODE.toLowerCase().trim()]; | |
| 37 | 37 | } | |
| 38 | 38 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -133,7 +133,7 @@ const visitorsWithoutAncestors = { | |||
| 133 | 133 | } | |
| 134 | 134 | ||
| 135 | 135 | walk.base.VariableDeclaration(node, state, c); | |
| 136 | - } | ||
| 136 | + }, | ||
| 137 | 137 | }; | |
| 138 | 138 | ||
| 139 | 139 | const visitors = {}; | |
@@ -209,7 +209,7 @@ function processTopLevelAwait(src) { | |||
| 209 | 209 | wrappedArray[node.end - 1] += str; | |
| 210 | 210 | }, | |
| 211 | 211 | containsAwait: false, | |
| 212 | - containsReturn: false | ||
| 212 | + containsReturn: false, | ||
| 213 | 213 | }; | |
| 214 | 214 | ||
| 215 | 215 | walk.recursive(body, state, visitors); | |
@@ -258,5 +258,5 @@ function processTopLevelAwait(src) { | |||
| 258 | 258 | } | |
| 259 | 259 | ||
| 260 | 260 | module.exports = { | |
| 261 | - processTopLevelAwait | ||
| 261 | + processTopLevelAwait, | ||
| 262 | 262 | }; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,7 +27,7 @@ const { tokTypes: tt, Parser: AcornParser } = | |||
| 27 | 27 | const { sendInspectorCommand } = require('internal/util/inspector'); | |
| 28 | 28 | ||
| 29 | 29 | const { | |
| 30 | - ERR_INSPECTOR_NOT_AVAILABLE | ||
| 30 | + ERR_INSPECTOR_NOT_AVAILABLE, | ||
| 31 | 31 | } = require('internal/errors').codes; | |
| 32 | 32 | ||
| 33 | 33 | const { | |
@@ -54,7 +54,7 @@ let debug = require('internal/util/debuglog').debuglog('repl', (fn) => { | |||
| 54 | 54 | const previewOptions = { | |
| 55 | 55 | colors: false, | |
| 56 | 56 | depth: 1, | |
| 57 | - showHidden: false | ||
| 57 | + showHidden: false, | ||
| 58 | 58 | }; | |
| 59 | 59 | ||
| 60 | 60 | const REPL_MODE_STRICT = Symbol('repl-strict'); | |
@@ -340,7 +340,7 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) { | |||
| 340 | 340 | colors: false, | |
| 341 | 341 | depth: 1, | |
| 342 | 342 | compact: true, | |
| 343 | - breakLength: Infinity | ||
| 343 | + breakLength: Infinity, | ||
| 344 | 344 | }, previewOptions); | |
| 345 | 345 | session.post('Runtime.callFunctionOn', { | |
| 346 | 346 | functionDeclaration: | |
@@ -349,7 +349,7 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) { | |||
| 349 | 349 | .getOwnPropertyDescriptor(globalThis, 'util') | |
| 350 | 350 | .get().inspect(v, ${inspectOptions})`, | |
| 351 | 351 | objectId: result.objectId, | |
| 352 | - arguments: [result] | ||
| 352 | + arguments: [result], | ||
| 353 | 353 | }, (error, preview) => { | |
| 354 | 354 | if (error) { | |
| 355 | 355 | callback(error); | |
@@ -520,7 +520,7 @@ function setupReverseSearch(repl) { | |||
| 520 | 520 | const alreadyMatched = new SafeSet(); | |
| 521 | 521 | const labels = { | |
| 522 | 522 | r: 'bck-i-search: ', | |
| 523 | - s: 'fwd-i-search: ' | ||
| 523 | + s: 'fwd-i-search: ', | ||
| 524 | 524 | }; | |
| 525 | 525 | let isInReverseSearch = false; | |
| 526 | 526 | let historyIndex = -1; | |
@@ -749,5 +749,5 @@ module.exports = { | |||
| 749 | 749 | isRecoverableError, | |
| 750 | 750 | kStandaloneREPL: Symbol('kStandaloneREPL'), | |
| 751 | 751 | setupPreview, | |
| 752 | - setupReverseSearch | ||
| 752 | + setupReverseSearch, | ||
| 753 | 753 | }; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -99,11 +99,11 @@ const { | |||
| 99 | 99 | const { BuiltinModule } = require('internal/bootstrap/loaders'); | |
| 100 | 100 | const { | |
| 101 | 101 | makeRequireFunction, | |
| 102 | - addBuiltinLibsToObject | ||
| 102 | + addBuiltinLibsToObject, | ||
| 103 | 103 | } = require('internal/modules/helpers'); | |
| 104 | 104 | const { | |
| 105 | 105 | isIdentifierStart, | |
| 106 | - isIdentifierChar | ||
| 106 | + isIdentifierChar, | ||
| 107 | 107 | } = require('internal/deps/acorn/acorn/dist/acorn'); | |
| 108 | 108 | const { | |
| 109 | 109 | decorateErrorStack, | |
@@ -118,7 +118,7 @@ const path = require('path'); | |||
| 118 | 118 | const fs = require('fs'); | |
| 119 | 119 | const { Interface } = require('readline'); | |
| 120 | 120 | const { | |
| 121 | - commonPrefix | ||
| 121 | + commonPrefix, | ||
| 122 | 122 | } = require('internal/readline/utils'); | |
| 123 | 123 | const { Console } = require('console'); | |
| 124 | 124 | const CJSModule = require('internal/modules/cjs/loader').Module; | |
@@ -173,7 +173,7 @@ const { | |||
| 173 | 173 | } = internalBinding('util'); | |
| 174 | 174 | const { | |
| 175 | 175 | startSigintWatchdog, | |
| 176 | - stopSigintWatchdog | ||
| 176 | + stopSigintWatchdog, | ||
| 177 | 177 | } = internalBinding('contextify'); | |
| 178 | 178 | ||
| 179 | 179 | const history = require('internal/repl/history'); | |
@@ -296,7 +296,7 @@ function REPLServer(prompt, | |||
| 296 | 296 | 'DEP0141') : | |
| 297 | 297 | (val) => this.input = val, | |
| 298 | 298 | enumerable: false, | |
| 299 | - configurable: true | ||
| 299 | + configurable: true, | ||
| 300 | 300 | }); | |
| 301 | 301 | ObjectDefineProperty(this, 'outputStream', { | |
| 302 | 302 | __proto__: null, | |
@@ -313,7 +313,7 @@ function REPLServer(prompt, | |||
| 313 | 313 | 'DEP0141') : | |
| 314 | 314 | (val) => this.output = val, | |
| 315 | 315 | enumerable: false, | |
| 316 | - configurable: true | ||
| 316 | + configurable: true, | ||
| 317 | 317 | }); | |
| 318 | 318 | ||
| 319 | 319 | this.allowBlockingCompletions = !!options.allowBlockingCompletions; | |
@@ -462,7 +462,7 @@ function REPLServer(prompt, | |||
| 462 | 462 | importModuleDynamically: (specifier, _, importAssertions) => { | |
| 463 | 463 | return asyncESM.esmLoader.import(specifier, parentURL, | |
| 464 | 464 | importAssertions); | |
| 465 | - } | ||
| 465 | + }, | ||
| 466 | 466 | }); | |
| 467 | 467 | } catch (fallbackError) { | |
| 468 | 468 | if (isRecoverableError(fallbackError, fallbackCode)) { | |
@@ -506,7 +506,7 @@ function REPLServer(prompt, | |||
| 506 | 506 | importModuleDynamically: (specifier, _, importAssertions) => { | |
| 507 | 507 | return asyncESM.esmLoader.import(specifier, parentURL, | |
| 508 | 508 | importAssertions); | |
| 509 | - } | ||
| 509 | + }, | ||
| 510 | 510 | }); | |
| 511 | 511 | } catch (e) { | |
| 512 | 512 | debug('parse error %j', code, e); | |
@@ -563,7 +563,7 @@ function REPLServer(prompt, | |||
| 563 | 563 | try { | |
| 564 | 564 | const scriptOptions = { | |
| 565 | 565 | displayErrors: false, | |
| 566 | - breakOnSigint: self.breakEvalOnSigint | ||
| 566 | + breakOnSigint: self.breakEvalOnSigint, | ||
| 567 | 567 | }; | |
| 568 | 568 | ||
| 569 | 569 | if (self.useGlobal) { | |
@@ -767,7 +767,7 @@ function REPLServer(prompt, | |||
| 767 | 767 | completer: options.completer || completer, | |
| 768 | 768 | terminal: options.terminal, | |
| 769 | 769 | historySize: options.historySize, | |
| 770 | - prompt | ||
| 770 | + prompt, | ||
| 771 | 771 | }]); | |
| 772 | 772 | ||
| 773 | 773 | self.resetContext(); | |
@@ -793,7 +793,7 @@ function REPLServer(prompt, | |||
| 793 | 793 | return ObjectAssign(writer.options, options); | |
| 794 | 794 | }, | |
| 795 | 795 | enumerable: true, | |
| 796 | - configurable: true | ||
| 796 | + configurable: true, | ||
| 797 | 797 | }); | |
| 798 | 798 | } | |
| 799 | 799 | } | |
@@ -967,7 +967,7 @@ function REPLServer(prompt, | |||
| 967 | 967 | ||
| 968 | 968 | const { | |
| 969 | 969 | clearPreview, | |
| 970 | - showPreview | ||
| 970 | + showPreview, | ||
| 971 | 971 | } = setupPreview( | |
| 972 | 972 | this, | |
| 973 | 973 | kContextId, | |
@@ -1097,7 +1097,7 @@ REPLServer.prototype.createContext = function() { | |||
| 1097 | 1097 | __proto__: null, | |
| 1098 | 1098 | configurable: true, | |
| 1099 | 1099 | writable: true, | |
| 1100 | - value: _console | ||
| 1100 | + value: _console, | ||
| 1101 | 1101 | }); | |
| 1102 | 1102 | } | |
| 1103 | 1103 | ||
@@ -1108,13 +1108,13 @@ REPLServer.prototype.createContext = function() { | |||
| 1108 | 1108 | __proto__: null, | |
| 1109 | 1109 | configurable: true, | |
| 1110 | 1110 | writable: true, | |
| 1111 | - value: replModule | ||
| 1111 | + value: replModule, | ||
| 1112 | 1112 | }); | |
| 1113 | 1113 | ObjectDefineProperty(context, 'require', { | |
| 1114 | 1114 | __proto__: null, | |
| 1115 | 1115 | configurable: true, | |
| 1116 | 1116 | writable: true, | |
| 1117 | - value: makeRequireFunction(replModule) | ||
| 1117 | + value: makeRequireFunction(replModule), | ||
| 1118 | 1118 | }); | |
| 1119 | 1119 | ||
| 1120 | 1120 | addBuiltinLibsToObject(context, '<REPL>'); | |
@@ -1140,7 +1140,7 @@ REPLServer.prototype.resetContext = function() { | |||
| 1140 | 1140 | this.underscoreAssigned = true; | |
| 1141 | 1141 | this.output.write('Expression assignment to _ now disabled.\n'); | |
| 1142 | 1142 | } | |
| 1143 | - } | ||
| 1143 | + }, | ||
| 1144 | 1144 | }); | |
| 1145 | 1145 | ||
| 1146 | 1146 | ObjectDefineProperty(this.context, '_error', { | |
@@ -1154,7 +1154,7 @@ REPLServer.prototype.resetContext = function() { | |||
| 1154 | 1154 | this.output.write( | |
| 1155 | 1155 | 'Expression assignment to _error now disabled.\n'); | |
| 1156 | 1156 | } | |
| 1157 | - } | ||
| 1157 | + }, | ||
| 1158 | 1158 | }); | |
| 1159 | 1159 | ||
| 1160 | 1160 | // Allow REPL extensions to extend the new context | |
@@ -1240,7 +1240,7 @@ function getGlobalLexicalScopeNames(contextId) { | |||
| 1240 | 1240 | return sendInspectorCommand((session) => { | |
| 1241 | 1241 | let names = []; | |
| 1242 | 1242 | session.post('Runtime.globalLexicalScopeNames', { | |
| 1243 | - executionContextId: contextId | ||
| 1243 | + executionContextId: contextId, | ||
| 1244 | 1244 | }, (error, result) => { | |
| 1245 | 1245 | if (!error) names = result.names; | |
| 1246 | 1246 | }); | |
@@ -1661,7 +1661,7 @@ function _memory(cmd) { | |||
| 1661 | 1661 | // scope will not work for this function. | |
| 1662 | 1662 | ArrayPrototypePush(self.lines.level, { | |
| 1663 | 1663 | line: self.lines.length - 1, | |
| 1664 | - depth: depth | ||
| 1664 | + depth: depth, | ||
| 1665 | 1665 | }); | |
| 1666 | 1666 | } else if (depth < 0) { | |
| 1667 | 1667 | // Going... up. | |
@@ -1711,7 +1711,7 @@ function defineDefaultCommands(repl) { | |||
| 1711 | 1711 | action: function() { | |
| 1712 | 1712 | this.clearBufferedCommand(); | |
| 1713 | 1713 | this.displayPrompt(); | |
| 1714 | - } | ||
| 1714 | + }, | ||
| 1715 | 1715 | }); | |
| 1716 | 1716 | ||
| 1717 | 1717 | let clearMessage; | |
@@ -1729,14 +1729,14 @@ function defineDefaultCommands(repl) { | |||
| 1729 | 1729 | this.resetContext(); | |
| 1730 | 1730 | } | |
| 1731 | 1731 | this.displayPrompt(); | |
| 1732 | - } | ||
| 1732 | + }, | ||
| 1733 | 1733 | }); | |
| 1734 | 1734 | ||
| 1735 | 1735 | repl.defineCommand('exit', { | |
| 1736 | 1736 | help: 'Exit the REPL', | |
| 1737 | 1737 | action: function() { | |
| 1738 | 1738 | this.close(); | |
| 1739 | - } | ||
| 1739 | + }, | ||
| 1740 | 1740 | }); | |
| 1741 | 1741 | ||
| 1742 | 1742 | repl.defineCommand('help', { | |
@@ -1756,7 +1756,7 @@ function defineDefaultCommands(repl) { | |||
| 1756 | 1756 | this.output.write('\nPress Ctrl+C to abort current expression, ' + | |
| 1757 | 1757 | 'Ctrl+D to exit the REPL\n'); | |
| 1758 | 1758 | this.displayPrompt(); | |
| 1759 | - } | ||
| 1759 | + }, | ||
| 1760 | 1760 | }); | |
| 1761 | 1761 | ||
| 1762 | 1762 | repl.defineCommand('save', { | |
@@ -1769,7 +1769,7 @@ function defineDefaultCommands(repl) { | |||
| 1769 | 1769 | this.output.write(`Failed to save: ${file}\n`); | |
| 1770 | 1770 | } | |
| 1771 | 1771 | this.displayPrompt(); | |
| 1772 | - } | ||
| 1772 | + }, | ||
| 1773 | 1773 | }); | |
| 1774 | 1774 | ||
| 1775 | 1775 | repl.defineCommand('load', { | |
@@ -1792,7 +1792,7 @@ function defineDefaultCommands(repl) { | |||
| 1792 | 1792 | this.output.write(`Failed to load: ${file}\n`); | |
| 1793 | 1793 | } | |
| 1794 | 1794 | this.displayPrompt(); | |
| 1795 | - } | ||
| 1795 | + }, | ||
| 1796 | 1796 | }); | |
| 1797 | 1797 | if (repl.terminal) { | |
| 1798 | 1798 | repl.defineCommand('editor', { | |
@@ -1801,7 +1801,7 @@ function defineDefaultCommands(repl) { | |||
| 1801 | 1801 | _turnOnEditorMode(this); | |
| 1802 | 1802 | this.output.write( | |
| 1803 | 1803 | '// Entering editor mode (Ctrl+D to finish, Ctrl+C to cancel)\n'); | |
| 1804 | - } | ||
| 1804 | + }, | ||
| 1805 | 1805 | }); | |
| 1806 | 1806 | } | |
| 1807 | 1807 | } | |
@@ -1818,15 +1818,15 @@ module.exports = { | |||
| 1818 | 1818 | REPLServer, | |
| 1819 | 1819 | REPL_MODE_SLOPPY, | |
| 1820 | 1820 | REPL_MODE_STRICT, | |
| 1821 | - Recoverable | ||
| 1821 | + Recoverable, | ||
| 1822 | 1822 | }; | |
| 1823 | 1823 | ||
| 1824 | 1824 | ObjectDefineProperty(module.exports, 'builtinModules', { | |
| 1825 | 1825 | __proto__: null, | |
| 1826 | 1826 | get: () => _builtinLibs, | |
| 1827 | 1827 | set: (val) => _builtinLibs = val, | |
| 1828 | 1828 | enumerable: true, | |
| 1829 | - configurable: true | ||
| 1829 | + configurable: true, | ||
| 1830 | 1830 | }); | |
| 1831 | 1831 | ||
| 1832 | 1832 | ObjectDefineProperty(module.exports, '_builtinLibs', { | |
@@ -1842,5 +1842,5 @@ ObjectDefineProperty(module.exports, '_builtinLibs', { | |||
| 1842 | 1842 | 'DEP0142', | |
| 1843 | 1843 | ) : (val) => _builtinLibs = val, | |
| 1844 | 1844 | enumerable: false, | |
| 1845 | - configurable: true | ||
| 1845 | + configurable: true, | ||
| 1846 | 1846 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments