]>
git.wh0rd.org - tt-rss.git/blob - lib/dojo/errors/create.js.uncompressed.js
1 define("dojo/errors/create", ["../_base/lang"], function(lang
){
2 return function(name
, ctor
, base
, props
){
5 var ErrorCtor = function(message
){
7 if(Error
.captureStackTrace
){
8 Error
.captureStackTrace(this, ErrorCtor
);
11 // Error.call() operates on the returned error
12 // object rather than operating on |this|
13 var err
= Error
.call(this, message
),
16 // Copy own properties from err to |this|
18 if(err
.hasOwnProperty(prop
)){
19 this[prop
] = err
[prop
];
23 // messsage is non-enumerable in ES5
24 this.message
= message
;
25 // stack is non-enumerable in at least Firefox
26 this.stack
= err
.stack
;
28 base
.apply(this, arguments
);
31 ctor
.apply(this, arguments
);
35 ErrorCtor
.prototype = lang
.delegate(base
.prototype, props
);
36 ErrorCtor
.prototype.name
= name
;
37 ErrorCtor
.prototype.constructor = ErrorCtor
;