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 ac84b10418753f1df8e9f21c9dbbe9dff2f85194..36146a5939c0cc70f18c0ffc459940e3ea041180 100644
--- a/third_party/blink/renderer/platform/bindings/v8_object_constructor.cc
+++ b/third_party/blink/renderer/platform/bindings/v8_object_constructor.cc
@@ -98,8 +98,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>();
   }
