mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[dart2js] (New RTI) Fix JSInvocationMirror.typeArguments
Change-Id: I198463b7b8b4f15b57133fc5d7481956da2793c1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113269 Reviewed-by: Stephen Adams <sra@google.com> Commit-Queue: Mayank Patke <fishythefish@google.com>
This commit is contained in:
parent
8d344498be
commit
6b531b2ba4
|
@ -1763,7 +1763,7 @@ class CommonElementsImpl
|
|||
|
||||
@override
|
||||
FunctionEntity get createRuntimeType => _options.experimentNewRti
|
||||
? _findRtiFunction('_createRuntimeType')
|
||||
? _findRtiFunction('createRuntimeType')
|
||||
: _findHelperFunction('createRuntimeType');
|
||||
|
||||
@override
|
||||
|
|
|
@ -357,8 +357,14 @@ class JSInvocationMirror implements Invocation {
|
|||
if (_typeArgumentCount == 0) return const <Type>[];
|
||||
int start = _arguments.length - _typeArgumentCount;
|
||||
var list = <Type>[];
|
||||
for (int index = 0; index < _typeArgumentCount; index++) {
|
||||
list.add(createRuntimeType(_arguments[start + index]));
|
||||
if (JS_GET_FLAG('USE_NEW_RTI')) {
|
||||
for (int index = 0; index < _typeArgumentCount; index++) {
|
||||
list.add(newRti.createRuntimeType(_arguments[start + index]));
|
||||
}
|
||||
} else {
|
||||
for (int index = 0; index < _typeArgumentCount; index++) {
|
||||
list.add(createRuntimeType(_arguments[start + index]));
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
|
|
@ -660,11 +660,11 @@ Rti getTypeFromTypesTable(/*int*/ _index) {
|
|||
|
||||
Type getRuntimeType(object) {
|
||||
Rti rti = _instanceFunctionType(object) ?? _nonClosureInstanceType(object);
|
||||
return _createRuntimeType(rti);
|
||||
return createRuntimeType(rti);
|
||||
}
|
||||
|
||||
/// Called from generated code.
|
||||
Type _createRuntimeType(Rti rti) {
|
||||
Type createRuntimeType(Rti rti) {
|
||||
_Type type = Rti._getCachedRuntimeType(rti);
|
||||
if (type != null) return type;
|
||||
// TODO(https://github.com/dart-lang/language/issues/428) For NNBD transition,
|
||||
|
@ -677,7 +677,7 @@ Type _createRuntimeType(Rti rti) {
|
|||
|
||||
/// Called from generated code in the constant pool.
|
||||
Type typeLiteral(String recipe) {
|
||||
return _createRuntimeType(findType(recipe));
|
||||
return createRuntimeType(findType(recipe));
|
||||
}
|
||||
|
||||
/// Implementation of [Type] based on Rti.
|
||||
|
|
Loading…
Reference in a new issue