| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * Helpers for lazy static initialization. | 6 * Helpers for lazy static initialization. |
| 7 */ | 7 */ |
| 8 var static$uninitialized = {}; | 8 var static$uninitialized = {}; |
| 9 var static$initializing = {}; | 9 var static$initializing = {}; |
| 10 | 10 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 child.prototype.constructor = child; | 149 child.prototype.constructor = child; |
| 150 } | 150 } |
| 151 } | 151 } |
| 152 | 152 |
| 153 /** | 153 /** |
| 154 * @param {Function} fn | 154 * @param {Function} fn |
| 155 * @param {Object|undefined} thisObj | 155 * @param {Object|undefined} thisObj |
| 156 * @param {...*} var_args | 156 * @param {...*} var_args |
| 157 */ | 157 */ |
| 158 function $bind(fn, thisObj, var_args) { | 158 function $bind(fn, thisObj, var_args) { |
| 159 var func; |
| 159 if (arguments.length > 2) { | 160 if (arguments.length > 2) { |
| 160 var boundArgs = Array.prototype.slice.call(arguments, 2); | 161 var boundArgs = Array.prototype.slice.call(arguments, 2); |
| 161 return function() { | 162 func = function() { |
| 162 // Prepend the bound arguments to the current arguments. | 163 // Prepend the bound arguments to the current arguments. |
| 163 var newArgs = Array.prototype.slice.call(arguments); | 164 var newArgs = Array.prototype.slice.call(arguments); |
| 164 Array.prototype.unshift.apply(newArgs, boundArgs); | 165 Array.prototype.unshift.apply(newArgs, boundArgs); |
| 165 return fn.apply(thisObj, newArgs); | 166 return fn.apply(thisObj, newArgs); |
| 166 }; | 167 }; |
| 167 } else { | 168 } else { |
| 168 return function() { | 169 func = function() { |
| 169 return fn.apply(thisObj, arguments); | 170 return fn.apply(thisObj, arguments); |
| 170 }; | 171 }; |
| 171 } | 172 } |
| 173 if(fn.$lookupRTT) { |
| 174 func.$lookupRTT = function() { |
| 175 return fn.$lookupRTT.apply(thisObj, arguments); |
| 176 }; |
| 177 } |
| 178 return func; |
| 172 } | 179 } |
| 173 | 180 |
| 174 /** | 181 /** |
| 175 * Dart null object that should be used by JS implementation to test for | 182 * Dart null object that should be used by JS implementation to test for |
| 176 * Dart null. | 183 * Dart null. |
| 177 * | 184 * |
| 178 * TODO(ngeoffray): update dartc to generate this variable instead of | 185 * TODO(ngeoffray): update dartc to generate this variable instead of |
| 179 * undefined. | 186 * undefined. |
| 180 * @const | 187 * @const |
| 181 */ | 188 */ |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 return match; | 470 return match; |
| 464 } | 471 } |
| 465 o.$dartConstId = id; | 472 o.$dartConstId = id; |
| 466 $consts[key] = o; | 473 $consts[key] = o; |
| 467 return o; | 474 return o; |
| 468 } | 475 } |
| 469 | 476 |
| 470 function $Dart$MapLiteralFactory() { | 477 function $Dart$MapLiteralFactory() { |
| 471 return native__CoreJsUtil__newMapLiteral(); | 478 return native__CoreJsUtil__newMapLiteral(); |
| 472 } | 479 } |
| OLD | NEW |