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

Unified Diff: sdk/lib/_internal/js_runtime/lib/js_helper.dart

Issue 2565413002: Fix rti encoding of generic methods (Closed)
Patch Set: Add comment. Created 4 years 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 | « pkg/compiler/lib/src/js_backend/runtime_types.dart ('k') | tests/language/generic_method_types_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/js_runtime/lib/js_helper.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/js_helper.dart b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
index 936893018d7978a746d71403d63f8abc989619a3..f46975eb8f9b96f2f413d4e776d7c46458a7c091 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
@@ -2607,18 +2607,21 @@ abstract class Closure implements Function {
})(#, #)''',
RAW_DART_FUNCTION_REF(getType),
functionType);
- } else if (!isStatic
- && JS('bool', 'typeof # == "function"', functionType)) {
- var getReceiver = isIntercepted
- ? RAW_DART_FUNCTION_REF(BoundClosure.receiverOf)
- : RAW_DART_FUNCTION_REF(BoundClosure.selfOf);
- signatureFunction = JS(
- '',
- 'function(f,r){'
- 'return function(){'
- 'return f.apply({\$receiver:r(this)},arguments)'
- '}'
- '}(#,#)', functionType, getReceiver);
+ } else if (JS('bool', 'typeof # == "function"', functionType)) {
+ if (isStatic) {
+ signatureFunction = functionType;
+ } else {
+ var getReceiver = isIntercepted
+ ? RAW_DART_FUNCTION_REF(BoundClosure.receiverOf)
+ : RAW_DART_FUNCTION_REF(BoundClosure.selfOf);
+ signatureFunction = JS(
+ '',
+ 'function(f,r){'
+ 'return function(){'
+ 'return f.apply({\$receiver:r(this)},arguments)'
+ '}'
+ '}(#,#)', functionType, getReceiver);
+ }
} else {
throw 'Error in reflectionInfo.';
}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/runtime_types.dart ('k') | tests/language/generic_method_types_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698