mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:19:48 +00:00
[dart2js] Revert to old Closure.toString() implementation for old RTI.
TBR=sra@google.com Change-Id: Ie23953c6aa3c3b4e286eeb2d23889bc4357c098f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113904 Reviewed-by: Mayank Patke <fishythefish@google.com> Commit-Queue: Mayank Patke <fishythefish@google.com>
This commit is contained in:
parent
f842b03de5
commit
293eee940b
|
@ -2558,10 +2558,17 @@ abstract class Closure implements Function {
|
|||
// to be visible to resolution and the generation of extra stubs.
|
||||
|
||||
String toString() {
|
||||
var constructor = JS('', '#.constructor', this);
|
||||
String name =
|
||||
constructor == null ? null : JS('String|Null', '#.name', constructor);
|
||||
if (name == null) name = 'unknown';
|
||||
String name;
|
||||
if (JS_GET_FLAG('USE_NEW_RTI')) {
|
||||
var constructor = JS('', '#.constructor', this);
|
||||
name =
|
||||
constructor == null ? null : JS('String|Null', '#.name', constructor);
|
||||
if (name == null) name = 'unknown';
|
||||
} else {
|
||||
name = Primitives.objectTypeName(this);
|
||||
// Mirrors puts a space in front of some names, so remove it.
|
||||
name = JS('String', '#.trim()', name);
|
||||
}
|
||||
return "Closure '$name'";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue