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

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

Issue 2699073003: Support `void` as generic argument.
Patch Set: Shuffle things around to have a better `voidRti` locality. Created 3 years, 7 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 | « sdk/lib/_internal/js_runtime/lib/js_helper.dart ('k') | sdk/lib/_internal/js_runtime/lib/js_rti.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_mirrors.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/js_mirrors.dart b/sdk/lib/_internal/js_runtime/lib/js_mirrors.dart
index 94231b01967bd41bff101e62f9e66390868c7430..25a83f73a7c760e0e0b15ec27eff2797ef07350a 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_mirrors.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_mirrors.dart
@@ -35,6 +35,7 @@ import 'dart:_js_helper'
BoundClosure,
CachedInvocation,
Closure,
+ isVoidType,
JSInvocationMirror,
JsCache,
Primitives,
@@ -2676,11 +2677,6 @@ class JsFunctionTypeMirror extends BrokenClassMirror
JS_GET_NAME(JsGetName.FUNCTION_TYPE_RETURN_TYPE_TAG));
}
- bool get _isVoid {
- return JS('bool', '!!#[#]', _typeData,
- JS_GET_NAME(JsGetName.FUNCTION_TYPE_VOID_RETURN_TAG));
- }
-
bool get _hasArguments {
return JS(
'bool',
@@ -2725,7 +2721,6 @@ class JsFunctionTypeMirror extends BrokenClassMirror
TypeMirror get returnType {
if (_cachedReturnType != null) return _cachedReturnType;
- if (_isVoid) return _cachedReturnType = JsMirrorSystem._voidType;
if (!_hasReturnType) return _cachedReturnType = JsMirrorSystem._dynamicType;
return _cachedReturnType =
typeMirrorFromRuntimeTypeRepresentation(owner, _returnType);
@@ -2801,9 +2796,7 @@ class JsFunctionTypeMirror extends BrokenClassMirror
s += '}';
}
s += ') -> ';
- if (_isVoid) {
- s += 'void';
- } else if (_hasReturnType) {
+ if (_hasReturnType) {
s += _unmangleIfPreserved(runtimeTypeToString(_returnType));
} else {
s += 'dynamic';
@@ -2838,6 +2831,10 @@ TypeMirror typeMirrorFromRuntimeTypeRepresentation(
return JsMirrorSystem._dynamicType;
}
+ if (isVoidType(type)) {
+ return JsMirrorSystem._voidType;
+ }
+
ClassMirror ownerClass;
DeclarationMirror context = owner;
while (context != null) {
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/js_helper.dart ('k') | sdk/lib/_internal/js_runtime/lib/js_rti.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698