| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8a42a20 commit 4834be3
14 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -445,7 +445,9 @@ function enhanceStackTrace(err, own) { | |||
| 445 | 445 | const { name } = this.constructor; | |
| 446 | 446 | if (name !== 'EventEmitter') | |
| 447 | 447 | ctorInfo = ` on ${name} instance`; | |
| 448 | - } catch {} | ||
| 448 | + } catch { | ||
| 449 | + // Continue regardless of error. | ||
| 450 | + } | ||
| 449 | 451 | const sep = `\nEmitted 'error' event${ctorInfo} at:\n`; | |
| 450 | 452 | ||
| 451 | 453 | const errStack = ArrayPrototypeSlice( | |
@@ -493,7 +495,9 @@ EventEmitter.prototype.emit = function emit(type, ...args) { | |||
| 493 | 495 | value: FunctionPrototypeBind(enhanceStackTrace, this, er, capture), | |
| 494 | 496 | configurable: true | |
| 495 | 497 | }); | |
| 496 | - } catch {} | ||
| 498 | + } catch { | ||
| 499 | + // Continue regardless of error. | ||
| 500 | + } | ||
| 497 | 501 | ||
| 498 | 502 | // Note: The comments on the `throw` lines are intentional, they show | |
| 499 | 503 | // up in Node's output if this results in an unhandled exception. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1600,7 +1600,9 @@ function symlink(target, path, type_, callback_) { | |||
| 1600 | 1600 | // errors consistent between platforms if invalid path is | |
| 1601 | 1601 | // provided. | |
| 1602 | 1602 | absoluteTarget = pathModule.resolve(path, '..', target); | |
| 1603 | - } catch { } | ||
| 1603 | + } catch { | ||
| 1604 | + // Continue regardless of error. | ||
| 1605 | + } | ||
| 1604 | 1606 | if (absoluteTarget !== undefined) { | |
| 1605 | 1607 | stat(absoluteTarget, (err, stat) => { | |
| 1606 | 1608 | const resolvedType = !err && stat.isDirectory() ? 'dir' : 'file'; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -101,7 +101,9 @@ function patchProcessObject(expandArgv1) { | |||
| 101 | 101 | const path = require('path'); | |
| 102 | 102 | try { | |
| 103 | 103 | process.argv[1] = path.resolve(process.argv[1]); | |
| 104 | - } catch {} | ||
| 104 | + } catch { | ||
| 105 | + // Continue regardless of error. | ||
| 106 | + } | ||
| 105 | 107 | } | |
| 106 | 108 | ||
| 107 | 109 | // TODO(joyeecheung): most of these should be deprecated and removed, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -48,7 +48,9 @@ function TryGetAllProperties(object, target = object) { | |||
| 48 | 48 | if (getter && key !== '__proto__') { | |
| 49 | 49 | try { | |
| 50 | 50 | descriptor.value = FunctionPrototypeCall(getter, target); | |
| 51 | - } catch {} | ||
| 51 | + } catch { | ||
| 52 | + // Continue regardless of error. | ||
| 53 | + } | ||
| 52 | 54 | } | |
| 53 | 55 | if ('value' in descriptor && typeof descriptor.value !== 'function') { | |
| 54 | 56 | delete descriptor.get; | |
@@ -107,11 +109,15 @@ function serializeError(error) { | |||
| 107 | 109 | } | |
| 108 | 110 | } | |
| 109 | 111 | } | |
| 110 | - } catch {} | ||
| 112 | + } catch { | ||
| 113 | + // Continue regardless of error. | ||
| 114 | + } | ||
| 111 | 115 | try { | |
| 112 | 116 | const serialized = serialize(error); | |
| 113 | 117 | return Buffer.concat([Buffer.from([kSerializedObject]), serialized]); | |
| 114 | - } catch {} | ||
| 118 | + } catch { | ||
| 119 | + // Continue regardless of error. | ||
| 120 | + } | ||
| 115 | 121 | return Buffer.concat([Buffer.from([kInspectedError]), | |
| 116 | 122 | Buffer.from(inspect(error), 'utf8')]); | |
| 117 | 123 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -226,14 +226,18 @@ function workerOnGlobalUncaughtException(error, fromPromise) { | |||
| 226 | 226 | if (!handlerThrew) { | |
| 227 | 227 | process.emit('exit', process.exitCode); | |
| 228 | 228 | } | |
| 229 | - } catch {} | ||
| 229 | + } catch { | ||
| 230 | + // Continue regardless of error. | ||
| 231 | + } | ||
| 230 | 232 | } | |
| 231 | 233 | ||
| 232 | 234 | let serialized; | |
| 233 | 235 | try { | |
| 234 | 236 | const { serializeError } = require('internal/error_serdes'); | |
| 235 | 237 | serialized = serializeError(error); | |
| 236 | - } catch {} | ||
| 238 | + } catch { | ||
| 239 | + // Continue regardless of error. | ||
| 240 | + } | ||
| 237 | 241 | debug(`[${threadId}] uncaught exception serialized = ${!!serialized}`); | |
| 238 | 242 | if (serialized) | |
| 239 | 243 | port.postMessage({ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1128,7 +1128,9 @@ Module._extensions['.js'] = function(module, filename) { | |||
| 1128 | 1128 | let parentSource; | |
| 1129 | 1129 | try { | |
| 1130 | 1130 | parentSource = fs.readFileSync(parentPath, 'utf8'); | |
| 1131 | - } catch {} | ||
| 1131 | + } catch { | ||
| 1132 | + // Continue regardless of error. | ||
| 1133 | + } | ||
| 1132 | 1134 | if (parentSource) { | |
| 1133 | 1135 | const errLine = StringPrototypeSplit( | |
| 1134 | 1136 | StringPrototypeSlice(err.stack, StringPrototypeIndexOf( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -154,7 +154,9 @@ class ModuleJob { | |||
| 154 | 154 | // care about CommonJS for the purposes of this error message. | |
| 155 | 155 | ({ format } = | |
| 156 | 156 | await this.loader.load(childFileURL)); | |
| 157 | - } catch {} | ||
| 157 | + } catch { | ||
| 158 | + // Continue regardless of error. | ||
| 159 | + } | ||
| 158 | 160 | ||
| 159 | 161 | if (format === 'commonjs') { | |
| 160 | 162 | const importStatement = splitStack[1]; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -474,7 +474,9 @@ function resolvePackageTargetString( | |||
| 474 | 474 | try { | |
| 475 | 475 | new URL(target); | |
| 476 | 476 | isURL = true; | |
| 477 | - } catch {} | ||
| 477 | + } catch { | ||
| 478 | + // Continue regardless of error. | ||
| 479 | + } | ||
| 478 | 480 | if (!isURL) { | |
| 479 | 481 | const exportTarget = pattern ? | |
| 480 | 482 | RegExpPrototypeSymbolReplace(patternRegEx, target, () => subpath) : | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -180,7 +180,9 @@ translators.set('commonjs', async function commonjsStrategy(url, source, | |||
| 180 | 180 | let value; | |
| 181 | 181 | try { | |
| 182 | 182 | value = exports[exportName]; | |
| 183 | - } catch {} | ||
| 183 | + } catch { | ||
| 184 | + // Continue regardless of error. | ||
| 185 | + } | ||
| 184 | 186 | this.setExport(exportName, value); | |
| 185 | 187 | } | |
| 186 | 188 | this.setExport('default', exports); | |
@@ -205,7 +207,9 @@ function cjsPreparseModuleExports(filename) { | |||
| 205 | 207 | let source; | |
| 206 | 208 | try { | |
| 207 | 209 | source = readFileSync(filename, 'utf8'); | |
| 208 | - } catch {} | ||
| 210 | + } catch { | ||
| 211 | + // Continue regardless of error. | ||
| 212 | + } | ||
| 209 | 213 | ||
| 210 | 214 | let exports, reexports; | |
| 211 | 215 | try { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -639,7 +639,9 @@ function canonicalizeSpecifier(specifier, base) { | |||
| 639 | 639 | return resolve(specifier, base).href; | |
| 640 | 640 | } | |
| 641 | 641 | return resolve(specifier).href; | |
| 642 | - } catch {} | ||
| 642 | + } catch { | ||
| 643 | + // Continue regardless of error. | ||
| 644 | + } | ||
| 643 | 645 | return specifier; | |
| 644 | 646 | } | |
| 645 | 647 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments