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

Unified Diff: lib/src/codegen/js_codegen.dart

Issue 1293293002: Attach type info to extension method and object method tear-offs (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Rebase Created 5 years, 4 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 | « lib/runtime/_classes.js ('k') | test/browser/runtime_tests.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/codegen/js_codegen.dart
diff --git a/lib/src/codegen/js_codegen.dart b/lib/src/codegen/js_codegen.dart
index bb73a3cb104db8624875837fc86061c2952b312c..80e21de15f17c33ce2ff5dc7e77304955f9cf7cd 100644
--- a/lib/src/codegen/js_codegen.dart
+++ b/lib/src/codegen/js_codegen.dart
@@ -2456,9 +2456,10 @@ class JSCodegenVisitor extends GeneralizingAstVisitor {
String code;
if (member != null && member is MethodElement && !isStatic) {
// Tear-off methods: explicitly bind it.
- // TODO(leafp): Attach runtime types to these static tearoffs
if (_requiresStaticDispatch(target, memberId.name)) {
- return js.call('dart.#.bind(#)', [name, _visit(target)]);
+ var type = member.type;
+ var clos = js.call('dart.#.bind(#)', [name, _visit(target)]);
+ return js.call('dart.fn(#, #)', [clos, _emitFunctionTypeParts(type)]);
}
code = 'dart.bind(#, #)';
} else if (_requiresStaticDispatch(target, memberId.name)) {
« no previous file with comments | « lib/runtime/_classes.js ('k') | test/browser/runtime_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698