diff options
author | Andrew Dolgov <[email protected]> | 2013-03-18 10:26:24 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-03-18 10:26:26 +0400 |
commit | f0cfe83e3725f9a3928da97a6e3085e79cb25309 (patch) | |
tree | 4b0af188defaa807c7bc6ff3a101b41c9166c463 /lib/dojo/errors/create.js.uncompressed.js | |
parent | 9a2885da170ffd64358b99194095851a2d09c1b6 (diff) |
upgrade dojo to 1.8.3 (refs #570)
Diffstat (limited to 'lib/dojo/errors/create.js.uncompressed.js')
-rw-r--r-- | lib/dojo/errors/create.js.uncompressed.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/dojo/errors/create.js.uncompressed.js b/lib/dojo/errors/create.js.uncompressed.js new file mode 100644 index 000000000..d303a6a77 --- /dev/null +++ b/lib/dojo/errors/create.js.uncompressed.js @@ -0,0 +1,41 @@ +define("dojo/errors/create", ["../_base/lang"], function(lang){ + return function(name, ctor, base, props){ + base = base || Error; + + var ErrorCtor = function(message){ + if(base === Error){ + if(Error.captureStackTrace){ + Error.captureStackTrace(this, ErrorCtor); + } + + // Error.call() operates on the returned error + // object rather than operating on |this| + var err = Error.call(this, message), + prop; + + // Copy own properties from err to |this| + for(prop in err){ + if(err.hasOwnProperty(prop)){ + this[prop] = err[prop]; + } + } + + // messsage is non-enumerable in ES5 + this.message = message; + // stack is non-enumerable in at least Firefox + this.stack = err.stack; + }else{ + base.apply(this, arguments); + } + if(ctor){ + ctor.apply(this, arguments); + } + }; + + ErrorCtor.prototype = lang.delegate(base.prototype, props); + ErrorCtor.prototype.name = name; + ErrorCtor.prototype.constructor = ErrorCtor; + + return ErrorCtor; + }; +}); |