| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // The following code is taken from: | 5 // The following code is taken from: |
| 6 // http://code.google.com/p/browsersync/source/browse/trunk/client/lib/base/lang
.js | 6 // http://code.google.com/p/browsersync/source/browse/trunk/client/lib/base/lang
.js |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * Partially applies this function to a particular "this object" and zero or | 9 * Partially applies this function to a particular "this object" and zero or |
| 10 * more arguments. The result is a new function with some arguments of the first | 10 * more arguments. The result is a new function with some arguments of the first |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 * An alias to the bind() global function. | 63 * An alias to the bind() global function. |
| 64 * | 64 * |
| 65 * Usage: | 65 * Usage: |
| 66 * var g = f.bind(obj, arg1, arg2); | 66 * var g = f.bind(obj, arg1, arg2); |
| 67 * g(arg3, arg4); | 67 * g(arg3, arg4); |
| 68 */ | 68 */ |
| 69 Function.prototype.bind = function(self, var_args) { | 69 Function.prototype.bind = function(self, var_args) { |
| 70 return bind.apply( | 70 return bind.apply( |
| 71 null, [this, self].concat(Array.prototype.slice.call(arguments, 1))); | 71 null, [this, self].concat(Array.prototype.slice.call(arguments, 1))); |
| 72 } | 72 } |
| OLD | NEW |