[kernel] Return null string as source if no source available

Fixes #31793.

Bug:
Change-Id: If3ecf67387087db6a36f736c0f259b49eb133391
Reviewed-on: https://dart-review.googlesource.com/32767
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This commit is contained in:
Jens Johansen 2018-01-08 13:33:32 +01:00 committed by commit-bot@chromium.org
parent ab636dfbd1
commit c48ddcb025

View file

@ -9350,6 +9350,9 @@ bool Script::HasSource() const {
RawString* Script::Source() const {
String& source = String::Handle(raw_ptr()->source_);
if (source.IsNull()) {
if (kind() == RawScript::kKernelTag) {
return String::null();
}
return GenerateSource();
}
return raw_ptr()->source_;