[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:
Nicholas Shahan 2023-08-12 00:31:55 +00:00 committed by Commit Queue
parent 083b3e5150
commit 0c8224cf2f

View file

@ -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;