[dart2js] Fix failing web/deferred_fail_and_retry_test on d8 platform.

'document.body' is not defined on the d8 platform but 'document' is so this was throwing.

Change-Id: I6e4049d86beedf4dbadee466fa581e4d3426df41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311560
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
This commit is contained in:
Nate Biggs 2023-06-27 18:25:30 +00:00 committed by Commit Queue
parent d9b676b0be
commit 6378357ef4
2 changed files with 2 additions and 2 deletions

View file

@ -15,7 +15,7 @@ main() {
js.context.callMethod("eval", [
"""
retryCount = 0;
if (self.document) {
if (self.document && self.document.body) {
oldAppendChild = document.body.appendChild;
replacement = function(element) {
element.src = "non_existing.js";

View file

@ -17,7 +17,7 @@ main() {
js.context.callMethod("eval", [
"""
retryCount = 0;
if (self.document) {
if (self.document && self.document.body) {
oldAppendChild = document.body.appendChild;
replacement = function(element) {
element.src = "non_existing.js";