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

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart

Issue 2827333003: Tighten up handling of JS types and add test. (Closed)
Patch Set: Tighten up handling of JS types. Fix bug where helpers in js_mirrors were specifying name had type … Created 3 years, 8 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
Index: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
index a0f02c7ac40553dacd76821115e80be28454f948..12d984b0cdfbfb10f7155174e9ab7be3112e081a 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
@@ -271,11 +271,16 @@ bind(obj, name, f) => JS(
'',
'''(() => {
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($getType($obj), $name);
- $assert_(sig);
+
+ // JS interop case: do not bind this for compatibility with the dart2js
+ // implementation where we cannot bind this reliably here until we trust
+ // types more.
+ if (sig === void 0) return $f;
+
+ $f = $f.bind($obj);
$tag($f, sig);
return $f;
})()''');

Powered by Google App Engine
This is Rietveld 408576698