mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-19 03:44:23 -05:00
implementing grayrest's suggested cleanup for object comprehensions
This commit is contained in:
@@ -54,11 +54,9 @@
|
||||
return __a;
|
||||
}
|
||||
__f = obj;
|
||||
for (key in __f) {
|
||||
for (key in __f) if (__hasProp.call(__f, key)) {
|
||||
val = __f[key];
|
||||
if (__hasProp.call(__f, key)) {
|
||||
iterator.call(context, val, key, obj);
|
||||
}
|
||||
iterator.call(context, val, key, obj);
|
||||
}
|
||||
} catch (e) {
|
||||
if (e !== breaker) {
|
||||
@@ -180,12 +178,10 @@
|
||||
return _.indexOf(obj, target) !== -1;
|
||||
}
|
||||
__a = obj;
|
||||
for (key in __a) {
|
||||
for (key in __a) if (__hasProp.call(__a, key)) {
|
||||
val = __a[key];
|
||||
if (__hasProp.call(__a, key)) {
|
||||
if (val === target) {
|
||||
return true;
|
||||
}
|
||||
if (val === target) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -528,11 +524,9 @@
|
||||
return _.range(0, obj.length);
|
||||
}
|
||||
__a = []; __b = obj;
|
||||
for (key in __b) {
|
||||
for (key in __b) if (__hasProp.call(__b, key)) {
|
||||
val = __b[key];
|
||||
if (__hasProp.call(__b, key)) {
|
||||
__a.push(key);
|
||||
}
|
||||
__a.push(key);
|
||||
}
|
||||
return __a;
|
||||
};
|
||||
@@ -550,11 +544,9 @@
|
||||
_.extend = function extend(destination, source) {
|
||||
var __a, key, val;
|
||||
__a = source;
|
||||
for (key in __a) {
|
||||
for (key in __a) if (__hasProp.call(__a, key)) {
|
||||
val = __a[key];
|
||||
if (__hasProp.call(__a, key)) {
|
||||
destination[key] = val;
|
||||
}
|
||||
destination[key] = val;
|
||||
}
|
||||
return destination;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user