mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
coco 7222551: crushed __bind
This commit is contained in:
parent
6f47364392
commit
5de73f6c25
2 changed files with 3 additions and 7 deletions
|
@ -7,9 +7,7 @@
|
|||
for (var key in parent) if (__hasProp.call(parent, key)) child[key] = parent[key];
|
||||
child.__super__ = parent.prototype;
|
||||
return child;
|
||||
}, __bind = function(func, context) {
|
||||
return function() { return func.apply(context, arguments); };
|
||||
};
|
||||
}, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
||||
Scope = require('./scope').Scope;
|
||||
_ref = require('./helpers'), compact = _ref.compact, flatten = _ref.flatten, extend = _ref.extend, merge = _ref.merge, del = _ref.del, starts = _ref.starts, ends = _ref.ends, last = _ref.last;
|
||||
exports.extend = extend;
|
||||
|
@ -1960,7 +1958,7 @@
|
|||
};
|
||||
UTILITIES = {
|
||||
"extends": 'function(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor;\n for (var key in parent) if (__hasProp.call(parent, key)) child[key] = parent[key];\n child.__super__ = parent.prototype;\n return child;\n}',
|
||||
bind: 'function(func, context) {\n return function() { return func.apply(context, arguments); };\n}',
|
||||
bind: 'function(fn, me){ return function(){ return fn.apply(me, arguments); }; }',
|
||||
indexOf: 'Array.prototype.indexOf || function(item) {\n for (var i = 0, l = this.length; i < l; i++) {\n if (this[i] === item) return i;\n }\n return -1;\n}',
|
||||
hasProp: 'Object.prototype.hasOwnProperty',
|
||||
slice: 'Array.prototype.slice'
|
||||
|
|
|
@ -1598,9 +1598,7 @@ UTILITIES =
|
|||
|
||||
# Create a function bound to the current value of "this".
|
||||
bind: '''
|
||||
function(func, context) {
|
||||
return function() { return func.apply(context, arguments); };
|
||||
}
|
||||
function(fn, me){ return function(){ return fn.apply(me, arguments); }; }
|
||||
'''
|
||||
|
||||
# Discover if an item is in an array.
|
||||
|
|
Loading…
Reference in a new issue