mirror of
https://github.com/nodejs/node.git
synced 2026-12-06 10:58:49 -05:00
* install eslint-plugin-markdown * add doc/.eslintrc.yaml * add `<!-- eslint-disable rule -->` or `<!-- eslint-disable -->` for the rest of problematic code * .js files in doc folder added to .eslintignore * update Makefile and vcbuild.bat PR-URL: https://github.com/nodejs/node/pull/12563 Refs: https://github.com/nodejs/node/pull/12557#issuecomment-296015032 Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
35 lines
555 B
JavaScript
35 lines
555 B
JavaScript
/**
|
|
* @author Titus Wormer
|
|
* @copyright 2015 Titus Wormer
|
|
* @license MIT
|
|
* @module bail
|
|
* @fileoverview Throw a given error.
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/* Expose. */
|
|
module.exports = bail;
|
|
|
|
/**
|
|
* Throw a given error.
|
|
*
|
|
* @example
|
|
* bail();
|
|
*
|
|
* @example
|
|
* bail(new Error('failure'));
|
|
* // Error: failure
|
|
* // at repl:1:6
|
|
* // at REPLServer.defaultEval (repl.js:154:27)
|
|
* // ...
|
|
*
|
|
* @param {Error?} [err] - Optional error.
|
|
* @throws {Error} - `err`, when given.
|
|
*/
|
|
function bail(err) {
|
|
if (err) {
|
|
throw err;
|
|
}
|
|
}
|