public
/
UglifyJS.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
combined
(merge:
dc5f70e
dfa395f
)
Merge pull request #245 from ForbesLindesay/patch-1
author
Mihai Bazon
<mihai.bazon@gmail.com>
Tue, 10 Dec 2013 18:23:29 +0000
(10:23 -0800)
committer
Mihai Bazon
<mihai.bazon@gmail.com>
Tue, 10 Dec 2013 18:23:29 +0000
(10:23 -0800)
Make `DefaultsError` a real `Error` object
1
2
lib/utils.js
patch
|
diff1
|
diff2
|
blob
|
history
diff --cc
lib/utils.js
index
fa24663
,
20f9a8e
..
c7299e5
---
1
/
lib/utils.js
---
2
/
lib/utils.js
+++ b/
lib/utils.js
@@@
-85,11
-86,9
+86,13
@@@
function DefaultsError(msg, defs)
this.msg = msg;
this.defs = defs;
};
+ DefaultsError.prototype = Object.create(Error.prototype)
+ DefaultsError.prototype.constructor = DefaultsError
+DefaultsError.croak = function(msg, defs) {
+ throw new DefaultsError(msg, defs);
+};
+
function defaults(args, defs, croak) {
if (args === true)
args = {};