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

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

Issue 2613433002: Support generic methods in reflection. (Closed)
Patch Set: Cleanup. Created 3 years, 12 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 | tests/compiler/dart2js_extra/dart2js_extra.status » ('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 07d1cbb60b64be5572297a6b6252656ed7ee68e3..3be1e9d4954b206bc79732c92d9c029a846b3cdf 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
@@ -679,11 +679,14 @@ class ReflectionInfo {
if (JS('bool', 'typeof # == "number"', functionType)) {
return getType(functionType);
} else if (JS('bool', 'typeof # == "function"', functionType)) {
- var fakeInstance = JS('', 'new #()', jsConstructor);
- setRuntimeTypeInfo(
- fakeInstance, JS('JSExtendableArray', '#["<>"]', fakeInstance));
- return JS('=Object|Null', r'#.apply({$receiver:#})',
- functionType, fakeInstance);
+ if (jsConstructor != null) {
Siggi Cherem (dart-lang) 2017/01/03 18:58:13 can you give me some extra details of when this ha
Johnni Winther 2017/01/04 09:15:39 It was provoked by lrn's landing of https://codere
+ var fakeInstance = JS('', 'new #()', jsConstructor);
+ setRuntimeTypeInfo(
+ fakeInstance, JS('JSExtendableArray', '#["<>"]', fakeInstance));
+ return JS('=Object|Null', r'#.apply({$receiver:#})',
+ functionType, fakeInstance);
+ }
+ return functionType;
} else {
throw new RuntimeError('Unexpected function type');
}
« no previous file with comments | « no previous file | tests/compiler/dart2js_extra/dart2js_extra.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698