From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Thu, 20 Sep 2018 17:48:19 -0700
Subject: blink_fix_prototype_assert.patch

A recent Chromium change has accidentally added assertion for the case when
a new window object may not have a prototype attached. In Electron it may
happen when preventDefault for a native new-window event.
https://chromium.googlesource.com/chromium/src/+/f47b361887a31cccf42a6e21a82bccf28372bdaa%5E%21
In the long term we should investigate why it happened, and take a more
formal fix. But for now I'm just make this assertion silently pass away.

diff --git a/third_party/blink/renderer/platform/bindings/v8_object_constructor.cc b/third_party/blink/renderer/platform/bindings/v8_object_constructor.cc
index 196548f9b1a817348df05c889b315a8124e1692d..359165f1c52b8afb0d91d4a363da0429cf5372ef 100644
--- a/third_party/blink/renderer/platform/bindings/v8_object_constructor.cc
+++ b/third_party/blink/renderer/platform/bindings/v8_object_constructor.cc
@@ -95,8 +95,10 @@ v8::Local<v8::Function> V8ObjectConstructor::CreateInterfaceObject(
     bool get_prototype_value =
         interface_object->Get(context, V8AtomicString(isolate, "prototype"))
             .ToLocal(&prototype_value);
-    CHECK(get_prototype_value);
-    CHECK(prototype_value->IsObject());
+    // CHECK(get_prototype_value);
+    // CHECK(prototype_value->IsObject());
+    if (!get_prototype_value || !prototype_value->IsObject())
+      return v8::Local<v8::Function>();
 
     prototype_object = prototype_value.As<v8::Object>();
   }
