Chromium Code Reviews| Index: lib/runtime/_classes.js |
| diff --git a/lib/runtime/_classes.js b/lib/runtime/_classes.js |
| index 80ceb56249bf4fa36dca9b9729e255d701391dfd..630906455a3d66afcab5ab95fb6b7ffc98386172 100644 |
| --- a/lib/runtime/_classes.js |
| +++ b/lib/runtime/_classes.js |
| @@ -193,8 +193,11 @@ dart_library.library('dart_runtime/_classes', null, /* Imports */[ |
| /// Sets the runtime type of the torn off method appropriately, |
| /// and also binds the object. |
| /// TODO(leafp): Consider caching the tearoff on the object? |
| - function bind(obj, name) { |
| - let f = obj[name].bind(obj); |
| + function bind(obj, name, f) { |
|
Leaf
2015/09/10 17:42:41
Update the comment to describe the role of f?
Jennifer Messerly
2015/09/10 19:23:08
Nice catch! Done!
|
| + if (f === void 0) f = obj[name]; |
| + f = f.bind(obj); |
| + // TODO(jmesserly): track the function's signature on the function, instead |
| + // of having to go back to the class? |
| let sig = _getMethodType(obj, name); |
| assert(sig); |
| rtti.tag(f, sig); |