From 6378357ef4614f11b568b09fde0c3a5bf30f898d Mon Sep 17 00:00:00 2001 From: Nate Biggs Date: Tue, 27 Jun 2023 18:25:30 +0000 Subject: [PATCH] [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 Commit-Queue: Nate Biggs --- tests/web/deferred_fail_and_retry_test.dart | 2 +- tests/web_2/deferred_fail_and_retry_test.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/web/deferred_fail_and_retry_test.dart b/tests/web/deferred_fail_and_retry_test.dart index 5c62639502e..242457c5f35 100644 --- a/tests/web/deferred_fail_and_retry_test.dart +++ b/tests/web/deferred_fail_and_retry_test.dart @@ -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"; diff --git a/tests/web_2/deferred_fail_and_retry_test.dart b/tests/web_2/deferred_fail_and_retry_test.dart index c57c709054f..bd4ad7855d8 100644 --- a/tests/web_2/deferred_fail_and_retry_test.dart +++ b/tests/web_2/deferred_fail_and_retry_test.dart @@ -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";