Commit graph

1 commit

Author SHA1 Message Date
Stephen Adams c74dd07a4a Use interpolation in print and writeAll
Using interpolation ensures that a `null` returned from `o.toString()`
in a non-sound application is treated consistently.

The error message has been upgraded to include the receiver to make
it easier to find the method. Since this error values are reported using
`Error.safeToString`, this will be reported using the class name:

```
ArgumentError (object): toString method returned 'null': Instance of 'BadToString'
```

VM, DDC and dart2js runtimes are updated to make the handling consistent
on VM and web.

TEST=added

Change-Id: I48d8f721dfb3a431dbeacdaa39a9f3a8273e902c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214741
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-09-29 02:45:32 +00:00