mirror of
https://github.com/hanzoai/es5-ext.git
synced 2026-09-24 16:58:43 +00:00
fix(Error.custom): improve ext argument detection
This commit is contained in:
+3
-2
@@ -1,13 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
var assign = require('../object/assign')
|
||||
var assign = require('../object/assign')
|
||||
, isObject = require('../object/is-object')
|
||||
|
||||
, captureStackTrace = Error.captureStackTrace;
|
||||
|
||||
exports = module.exports = function (message/*, code, ext*/) {
|
||||
var err = new Error(message), code = arguments[1], ext = arguments[2];
|
||||
if (ext == null) {
|
||||
if (code && (typeof code === 'object')) {
|
||||
if (isObject(code)) {
|
||||
ext = code;
|
||||
code = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user