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

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

Issue 1803033002: Fixes #479 (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 9 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/dart/_runtime.js ('k') | tool/input_sdk/private/ddc_runtime/types.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/input_sdk/private/ddc_runtime/classes.dart
diff --git a/tool/input_sdk/private/ddc_runtime/classes.dart b/tool/input_sdk/private/ddc_runtime/classes.dart
index 4b27c394c23e3b3edc70caaf9a2b59c2f1120433..fa284f6a19c28221750d215ad05cc7397d849528 100644
--- a/tool/input_sdk/private/ddc_runtime/classes.dart
+++ b/tool/input_sdk/private/ddc_runtime/classes.dart
@@ -122,11 +122,16 @@ final _constructorSig = JS('', 'Symbol("sigCtor")');
final _methodSig = JS('', 'Symbol("sig")');
final _staticSig = JS('', 'Symbol("sigStatic")');
-/// Get the type of a method using the stored signature
+/// Get the type of a method from an object using the stored signature
getMethodType(obj, name) => JS('', '''(() => {
if ($obj === void 0) return void 0;
if ($obj == null) return void 0;
- let sigObj = $obj.__proto__.constructor[$_methodSig];
+ return $getMethodTypeFromType($obj.__proto__.constructor, $name);
+})()''');
+
+/// Get the type of a method from a type using the stored signature
+getMethodTypeFromType(type, name) => JS('', '''(() => {
+ let sigObj = $type[$_methodSig];
if (sigObj === void 0) return void 0;
let parts = sigObj[$name];
if (parts === void 0) return void 0;
« no previous file with comments | « lib/runtime/dart/_runtime.js ('k') | tool/input_sdk/private/ddc_runtime/types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698