Browse files

[dist] JSHint compliance

  • Loading branch information...
1 parent 02b713b commit fea6b741fe55ee697f4b1311009db4160fe5c445 @indexzero committed May 15, 2012
Showing with 16 additions and 16 deletions.
  1. +16 −16 lib/errs.js
View
32 lib/errs.js
@@ -18,16 +18,16 @@ exports.registered = {};
// Add `Error.prototype.toJSON` if it doesn't exist.
//
if (!Error.prototype.toJSON) {
- Object.defineProperty(Error.prototype, 'toJSON', {
- enumerable: false,
- value: function () {
- return mixin({
- message: this.message,
- stack: this.stack,
+ Object.defineProperty(Error.prototype, 'toJSON', {
+ enumerable: false,
+ value: function () {
+ return mixin({
+ message: this.message,
+ stack: this.stack,
arguments: this.arguments,
type: this.type
}, this);
- }
+ }
});
}
@@ -190,7 +190,7 @@ exports.handle = function (error, callback, stream) {
if (typeof callback === 'function') {
callback(error);
}
-
+
if (typeof callback !== 'function' || stream) {
var emitter = stream || callback || new events.EventEmitter();
process.nextTick(function () { emitter.emit('error', error); });
@@ -232,30 +232,30 @@ exports.unregister = function (type) {
//
function mixin(target) {
//
- // Quickly and performantly (in V8) `Arrayify` arguments.
+ // Quickly and performantly (in V8) `Arrayify` arguments.
//
var len = arguments.length,
args = new Array(len - 1),
i = 1;
-
+
for (; i < len; i++) {
args[i - 1] = arguments[i];
}
-
+
args.forEach(function (o) {
Object.keys(o).forEach(function (attr) {
var getter = o.__lookupGetter__(attr),
setter = o.__lookupSetter__(attr);
-
+
if (!getter && !setter) {
target[attr] = o[attr];
}
else {
- if (setter) target.__defineSetter__(attr, setter);
- if (getter) target.__defineGetter__(attr, getter);
+ if (setter) { target.__defineSetter__(attr, setter) }
+ if (getter) { target.__defineGetter__(attr, getter) }
}
});
});
-
+
return target;
-};
+}

0 comments on commit fea6b74

Please sign in to comment.