| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 331073a commit 91fbad6
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -281,7 +281,8 @@ overrides: | |||
| 281 | 281 | - ./internal/process/*.js | |
| 282 | 282 | - ./internal/readline/*.js | |
| 283 | 283 | - ./internal/readme.md | |
| 284 | - - ./internal/repl/history.js | ||
| 284 | + - ./internal/repl.js | ||
| 285 | + - ./internal/repl/*.js | ||
| 285 | 286 | - ./internal/source_map/prepare_stack_trace.js | |
| 286 | 287 | - ./internal/streams/*.js | |
| 287 | 288 | - ./internal/structured_clone.js | |
@@ -298,6 +299,7 @@ overrides: | |||
| 298 | 299 | - ./path/*.js | |
| 299 | 300 | - ./process.js | |
| 300 | 301 | - ./punycode.js | |
| 302 | + - ./repl.js | ||
| 301 | 303 | - ./stream/*.js | |
| 302 | 304 | - ./sys.js | |
| 303 | 305 | - ./test.js | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,7 +23,7 @@ function createRepl(env, opts, cb) { | |||
| 23 | 23 | ignoreUndefined: false, | |
| 24 | 24 | useGlobal: true, | |
| 25 | 25 | breakEvalOnSigint: true, | |
| 26 | - ...opts | ||
| 26 | + ...opts, | ||
| 27 | 27 | }; | |
| 28 | 28 | ||
| 29 | 29 | if (NumberParseInt(env.NODE_NO_READLINE)) { | |
@@ -33,7 +33,7 @@ function createRepl(env, opts, cb) { | |||
| 33 | 33 | if (env.NODE_REPL_MODE) { | |
| 34 | 34 | opts.replMode = { | |
| 35 | 35 | 'strict': REPL.REPL_MODE_STRICT, | |
| 36 | - 'sloppy': REPL.REPL_MODE_SLOPPY | ||
| 36 | + 'sloppy': REPL.REPL_MODE_SLOPPY, | ||
| 37 | 37 | }[env.NODE_REPL_MODE.toLowerCase().trim()]; | |
| 38 | 38 | } | |
| 39 | 39 | ||
| 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 | |
|---|---|---|---|
@@ -100,11 +100,11 @@ const { | |||
| 100 | 100 | const { BuiltinModule } = require('internal/bootstrap/loaders'); | |
| 101 | 101 | const { | |
| 102 | 102 | makeRequireFunction, | |
| 103 | - addBuiltinLibsToObject | ||
| 103 | + addBuiltinLibsToObject, | ||
| 104 | 104 | } = require('internal/modules/cjs/helpers'); | |
| 105 | 105 | const { | |
| 106 | 106 | isIdentifierStart, | |
| 107 | - isIdentifierChar | ||
| 107 | + isIdentifierChar, | ||
| 108 | 108 | } = require('internal/deps/acorn/acorn/dist/acorn'); | |
| 109 | 109 | const { | |
| 110 | 110 | decorateErrorStack, | |
@@ -119,7 +119,7 @@ const path = require('path'); | |||
| 119 | 119 | const fs = require('fs'); | |
| 120 | 120 | const { Interface } = require('readline'); | |
| 121 | 121 | const { | |
| 122 | - commonPrefix | ||
| 122 | + commonPrefix, | ||
| 123 | 123 | } = require('internal/readline/utils'); | |
| 124 | 124 | const { Console } = require('console'); | |
| 125 | 125 | const CJSModule = require('internal/modules/cjs/loader').Module; | |
@@ -174,7 +174,7 @@ const { | |||
| 174 | 174 | } = internalBinding('util'); | |
| 175 | 175 | const { | |
| 176 | 176 | startSigintWatchdog, | |
| 177 | - stopSigintWatchdog | ||
| 177 | + stopSigintWatchdog, | ||
| 178 | 178 | } = internalBinding('contextify'); | |
| 179 | 179 | ||
| 180 | 180 | const history = require('internal/repl/history'); | |
@@ -298,7 +298,7 @@ function REPLServer(prompt, | |||
| 298 | 298 | 'DEP0141') : | |
| 299 | 299 | (val) => this.input = val, | |
| 300 | 300 | enumerable: false, | |
| 301 | - configurable: true | ||
| 301 | + configurable: true, | ||
| 302 | 302 | }); | |
| 303 | 303 | ObjectDefineProperty(this, 'outputStream', { | |
| 304 | 304 | __proto__: null, | |
@@ -315,7 +315,7 @@ function REPLServer(prompt, | |||
| 315 | 315 | 'DEP0141') : | |
| 316 | 316 | (val) => this.output = val, | |
| 317 | 317 | enumerable: false, | |
| 318 | - configurable: true | ||
| 318 | + configurable: true, | ||
| 319 | 319 | }); | |
| 320 | 320 | ||
| 321 | 321 | this.allowBlockingCompletions = !!options.allowBlockingCompletions; | |
@@ -464,7 +464,7 @@ function REPLServer(prompt, | |||
| 464 | 464 | importModuleDynamically: (specifier, _, importAssertions) => { | |
| 465 | 465 | return asyncESM.esmLoader.import(specifier, parentURL, | |
| 466 | 466 | importAssertions); | |
| 467 | - } | ||
| 467 | + }, | ||
| 468 | 468 | }); | |
| 469 | 469 | } catch (fallbackError) { | |
| 470 | 470 | if (isRecoverableError(fallbackError, fallbackCode)) { | |
@@ -508,7 +508,7 @@ function REPLServer(prompt, | |||
| 508 | 508 | importModuleDynamically: (specifier, _, importAssertions) => { | |
| 509 | 509 | return asyncESM.esmLoader.import(specifier, parentURL, | |
| 510 | 510 | importAssertions); | |
| 511 | - } | ||
| 511 | + }, | ||
| 512 | 512 | }); | |
| 513 | 513 | } catch (e) { | |
| 514 | 514 | debug('parse error %j', code, e); | |
@@ -565,7 +565,7 @@ function REPLServer(prompt, | |||
| 565 | 565 | try { | |
| 566 | 566 | const scriptOptions = { | |
| 567 | 567 | displayErrors: false, | |
| 568 | - breakOnSigint: self.breakEvalOnSigint | ||
| 568 | + breakOnSigint: self.breakEvalOnSigint, | ||
| 569 | 569 | }; | |
| 570 | 570 | ||
| 571 | 571 | if (self.useGlobal) { | |
@@ -769,7 +769,7 @@ function REPLServer(prompt, | |||
| 769 | 769 | completer: options.completer || completer, | |
| 770 | 770 | terminal: options.terminal, | |
| 771 | 771 | historySize: options.historySize, | |
| 772 | - prompt | ||
| 772 | + prompt, | ||
| 773 | 773 | }]); | |
| 774 | 774 | ||
| 775 | 775 | self.resetContext(); | |
@@ -795,7 +795,7 @@ function REPLServer(prompt, | |||
| 795 | 795 | return ObjectAssign(writer.options, options); | |
| 796 | 796 | }, | |
| 797 | 797 | enumerable: true, | |
| 798 | - configurable: true | ||
| 798 | + configurable: true, | ||
| 799 | 799 | }); | |
| 800 | 800 | } | |
| 801 | 801 | } | |
@@ -969,7 +969,7 @@ function REPLServer(prompt, | |||
| 969 | 969 | ||
| 970 | 970 | const { | |
| 971 | 971 | clearPreview, | |
| 972 | - showPreview | ||
| 972 | + showPreview, | ||
| 973 | 973 | } = setupPreview( | |
| 974 | 974 | this, | |
| 975 | 975 | kContextId, | |
@@ -1099,7 +1099,7 @@ REPLServer.prototype.createContext = function() { | |||
| 1099 | 1099 | __proto__: null, | |
| 1100 | 1100 | configurable: true, | |
| 1101 | 1101 | writable: true, | |
| 1102 | - value: _console | ||
| 1102 | + value: _console, | ||
| 1103 | 1103 | }); | |
| 1104 | 1104 | } | |
| 1105 | 1105 | ||
@@ -1110,13 +1110,13 @@ REPLServer.prototype.createContext = function() { | |||
| 1110 | 1110 | __proto__: null, | |
| 1111 | 1111 | configurable: true, | |
| 1112 | 1112 | writable: true, | |
| 1113 | - value: replModule | ||
| 1113 | + value: replModule, | ||
| 1114 | 1114 | }); | |
| 1115 | 1115 | ObjectDefineProperty(context, 'require', { | |
| 1116 | 1116 | __proto__: null, | |
| 1117 | 1117 | configurable: true, | |
| 1118 | 1118 | writable: true, | |
| 1119 | - value: makeRequireFunction(replModule) | ||
| 1119 | + value: makeRequireFunction(replModule), | ||
| 1120 | 1120 | }); | |
| 1121 | 1121 | ||
| 1122 | 1122 | addBuiltinLibsToObject(context, '<REPL>'); | |
@@ -1142,7 +1142,7 @@ REPLServer.prototype.resetContext = function() { | |||
| 1142 | 1142 | this.underscoreAssigned = true; | |
| 1143 | 1143 | this.output.write('Expression assignment to _ now disabled.\n'); | |
| 1144 | 1144 | } | |
| 1145 | - } | ||
| 1145 | + }, | ||
| 1146 | 1146 | }); | |
| 1147 | 1147 | ||
| 1148 | 1148 | ObjectDefineProperty(this.context, '_error', { | |
@@ -1156,7 +1156,7 @@ REPLServer.prototype.resetContext = function() { | |||
| 1156 | 1156 | this.output.write( | |
| 1157 | 1157 | 'Expression assignment to _error now disabled.\n'); | |
| 1158 | 1158 | } | |
| 1159 | - } | ||
| 1159 | + }, | ||
| 1160 | 1160 | }); | |
| 1161 | 1161 | ||
| 1162 | 1162 | // Allow REPL extensions to extend the new context | |
@@ -1242,7 +1242,7 @@ function getGlobalLexicalScopeNames(contextId) { | |||
| 1242 | 1242 | return sendInspectorCommand((session) => { | |
| 1243 | 1243 | let names = []; | |
| 1244 | 1244 | session.post('Runtime.globalLexicalScopeNames', { | |
| 1245 | - executionContextId: contextId | ||
| 1245 | + executionContextId: contextId, | ||
| 1246 | 1246 | }, (error, result) => { | |
| 1247 | 1247 | if (!error) names = result.names; | |
| 1248 | 1248 | }); | |
@@ -1666,7 +1666,7 @@ function _memory(cmd) { | |||
| 1666 | 1666 | // scope will not work for this function. | |
| 1667 | 1667 | ArrayPrototypePush(self.lines.level, { | |
| 1668 | 1668 | line: self.lines.length - 1, | |
| 1669 | - depth: depth | ||
| 1669 | + depth: depth, | ||
| 1670 | 1670 | }); | |
| 1671 | 1671 | } else if (depth < 0) { | |
| 1672 | 1672 | // Going... up. | |
@@ -1716,7 +1716,7 @@ function defineDefaultCommands(repl) { | |||
| 1716 | 1716 | action: function() { | |
| 1717 | 1717 | this.clearBufferedCommand(); | |
| 1718 | 1718 | this.displayPrompt(); | |
| 1719 | - } | ||
| 1719 | + }, | ||
| 1720 | 1720 | }); | |
| 1721 | 1721 | ||
| 1722 | 1722 | let clearMessage; | |
@@ -1734,14 +1734,14 @@ function defineDefaultCommands(repl) { | |||
| 1734 | 1734 | this.resetContext(); | |
| 1735 | 1735 | } | |
| 1736 | 1736 | this.displayPrompt(); | |
| 1737 | - } | ||
| 1737 | + }, | ||
| 1738 | 1738 | }); | |
| 1739 | 1739 | ||
| 1740 | 1740 | repl.defineCommand('exit', { | |
| 1741 | 1741 | help: 'Exit the REPL', | |
| 1742 | 1742 | action: function() { | |
| 1743 | 1743 | this.close(); | |
| 1744 | - } | ||
| 1744 | + }, | ||
| 1745 | 1745 | }); | |
| 1746 | 1746 | ||
| 1747 | 1747 | repl.defineCommand('help', { | |
@@ -1761,7 +1761,7 @@ function defineDefaultCommands(repl) { | |||
| 1761 | 1761 | this.output.write('\nPress Ctrl+C to abort current expression, ' + | |
| 1762 | 1762 | 'Ctrl+D to exit the REPL\n'); | |
| 1763 | 1763 | this.displayPrompt(); | |
| 1764 | - } | ||
| 1764 | + }, | ||
| 1765 | 1765 | }); | |
| 1766 | 1766 | ||
| 1767 | 1767 | repl.defineCommand('save', { | |
@@ -1774,7 +1774,7 @@ function defineDefaultCommands(repl) { | |||
| 1774 | 1774 | this.output.write(`Failed to save: ${file}\n`); | |
| 1775 | 1775 | } | |
| 1776 | 1776 | this.displayPrompt(); | |
| 1777 | - } | ||
| 1777 | + }, | ||
| 1778 | 1778 | }); | |
| 1779 | 1779 | ||
| 1780 | 1780 | repl.defineCommand('load', { | |
@@ -1797,7 +1797,7 @@ function defineDefaultCommands(repl) { | |||
| 1797 | 1797 | this.output.write(`Failed to load: ${file}\n`); | |
| 1798 | 1798 | } | |
| 1799 | 1799 | this.displayPrompt(); | |
| 1800 | - } | ||
| 1800 | + }, | ||
| 1801 | 1801 | }); | |
| 1802 | 1802 | if (repl.terminal) { | |
| 1803 | 1803 | repl.defineCommand('editor', { | |
@@ -1806,7 +1806,7 @@ function defineDefaultCommands(repl) { | |||
| 1806 | 1806 | _turnOnEditorMode(this); | |
| 1807 | 1807 | this.output.write( | |
| 1808 | 1808 | '// Entering editor mode (Ctrl+D to finish, Ctrl+C to cancel)\n'); | |
| 1809 | - } | ||
| 1809 | + }, | ||
| 1810 | 1810 | }); | |
| 1811 | 1811 | } | |
| 1812 | 1812 | } | |
@@ -1823,15 +1823,15 @@ module.exports = { | |||
| 1823 | 1823 | REPLServer, | |
| 1824 | 1824 | REPL_MODE_SLOPPY, | |
| 1825 | 1825 | REPL_MODE_STRICT, | |
| 1826 | - Recoverable | ||
| 1826 | + Recoverable, | ||
| 1827 | 1827 | }; | |
| 1828 | 1828 | ||
| 1829 | 1829 | ObjectDefineProperty(module.exports, 'builtinModules', { | |
| 1830 | 1830 | __proto__: null, | |
| 1831 | 1831 | get: () => _builtinLibs, | |
| 1832 | 1832 | set: (val) => _builtinLibs = val, | |
| 1833 | 1833 | enumerable: true, | |
| 1834 | - configurable: true | ||
| 1834 | + configurable: true, | ||
| 1835 | 1835 | }); | |
| 1836 | 1836 | ||
| 1837 | 1837 | ObjectDefineProperty(module.exports, '_builtinLibs', { | |
@@ -1847,5 +1847,5 @@ ObjectDefineProperty(module.exports, '_builtinLibs', { | |||
| 1847 | 1847 | 'DEP0142', | |
| 1848 | 1848 | ) : (val) => _builtinLibs = val, | |
| 1849 | 1849 | enumerable: false, | |
| 1850 | - configurable: true | ||
| 1850 | + configurable: true, | ||
| 1851 | 1851 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments