mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 17:40:04 +00:00
[ddc] Temporarily allow safeStr()
to handle null
This change is intended to be a temporary fix until the broken internal test is fixed. Change-Id: I0f6c334bd54c605306318b95836e91755252580f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320340 Reviewed-by: Sigmund Cherem <sigmund@google.com> Commit-Queue: Nicholas Shahan <nshahan@google.com>
This commit is contained in:
parent
083b3e5150
commit
0c8224cf2f
|
@ -1117,6 +1117,8 @@ String str(obj) {
|
|||
/// Only called from generated code for string interpolation.
|
||||
@notNull
|
||||
String strSafe(obj) {
|
||||
// TODO(nshahan) Remove after internal test is fixed b/295486966.
|
||||
if (obj == null) return "null";
|
||||
// TODO(40614): Declare `result` as String once non-nullability is sound.
|
||||
final result = JS('', '#[#]()', obj, extensionSymbol('toString'));
|
||||
if (result is String) return result;
|
||||
|
|
Loading…
Reference in a new issue