Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Unified Diff: lib/runtime/_classes.js

Issue 1310513013: fixes #314, super method tear offs (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: add test Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/src/codegen/js_codegen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | lib/src/codegen/js_codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698