Sha256: ec33efd712a6e84390f8c3d3d06ab96e8ff113ccfc49049f8bfdc8d019993639
Contents?: true
Size: 1.15 KB
Versions: 15
Compression:
Stored size: 1.15 KB
Contents
/*! * chai * Copyright(c) 2011-2013 Jake Luer <jake@alogicalparadox.com> * MIT Licensed */ /*! * Main export */ module.exports = AssertionError; /** * # AssertionError (constructor) * * Create a new assertion error based on the Javascript * `Error` prototype. * * **Options** * - message * - actual * - expected * - operator * - startStackFunction * * @param {Object} options * @api public */ function AssertionError (options) { options = options || {}; this.message = options.message; this.actual = options.actual; this.expected = options.expected; this.operator = options.operator; this.showDiff = options.showDiff; if (options.stackStartFunction && Error.captureStackTrace) { var stackStartFunction = options.stackStartFunction; Error.captureStackTrace(this, stackStartFunction); } } /*! * Inherit from Error */ AssertionError.prototype = Object.create(Error.prototype); AssertionError.prototype.name = 'AssertionError'; AssertionError.prototype.constructor = AssertionError; /** * # toString() * * Override default to string method */ AssertionError.prototype.toString = function() { return this.message; };
Version data entries
15 entries across 15 versions & 1 rubygems