@@ -2107,19 +2107,39 @@ UTILITIES =
2107
2107
2108
2108
# Correctly set up a prototype chain for inheritance, including a reference
2109
2109
# to the superclass for `super()` calls, and copies of any static properties.
2110
- extends : -> """
2111
- function(child, parent) { for (var key in parent) { if (#{ utility ' hasProp' } .call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }
2112
- """
2110
+ extends : -> "
2111
+ function(child, parent) {
2112
+ for (var key in parent) {
2113
+ if (#{ utility ' hasProp' } .call(parent, key)) child[key] = parent[key];
2114
+ }
2115
+ function ctor() {
2116
+ this.constructor = child;
2117
+ }
2118
+ ctor.prototype = parent.prototype;
2119
+ child.prototype = new ctor();
2120
+ child.__super__ = parent.prototype;
2121
+ return child;
2122
+ }
2123
+ "
2113
2124
2114
2125
# Create a function bound to the current value of "this".
2115
- bind : -> '''
2116
- function(fn, me){ return function(){ return fn.apply(me, arguments); }; }
2117
- '''
2126
+ bind : -> '
2127
+ function(fn, me){
2128
+ return function(){
2129
+ return fn.apply(me, arguments);
2130
+ };
2131
+ }
2132
+ '
2118
2133
2119
2134
# Discover if an item is in an array.
2120
- indexOf : -> """
2121
- [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }
2122
- """
2135
+ indexOf : -> "
2136
+ [].indexOf || function(item) {
2137
+ for (var i = 0, l = this.length; i < l; i++) {
2138
+ if (i in this && this[i] === item) return i;
2139
+ }
2140
+ return -1;
2141
+ }
2142
+ "
2123
2143
2124
2144
# Shortcuts to speed up the lookup time for native functions.
2125
2145
hasProp : -> ' {}.hasOwnProperty'
0 commit comments