[ddc] Cleanup temporary fix in strSafe

Fix allowed it to accept null but it should never be called with a
nullable value.

Change-Id: I03b5d9b4906e9e4557a4f2720350c0c8176fec53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320841
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Nicholas Shahan <nshahan@google.com>
This commit is contained in:
Nicholas Shahan 2023-08-21 17:42:33 +00:00 committed by Commit Queue
parent ca9730325c
commit 7b6d9fb46e
2 changed files with 7 additions and 2 deletions

View file

@ -79,6 +79,13 @@
`globalJSObject` is also renamed to `globalContext` and returns the global
context used in the lowerings.
### Tools
#### Dart Dev Compiler (DDC)
- Applications compiled by DDC will no longer add members to the native
JavaScript Object prototype.
## 3.1.0
### Libraries

View file

@ -1117,8 +1117,6 @@ 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;