From 4ba91c938ec3a0ef17b8d8f1b3bc396f738d695f Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Tue, 31 Mar 2020 14:49:15 -0700 Subject: [PATCH] fix: screen module should still be creatable if the first create is before the ready event (#22895) --- shell/browser/api/electron_api_screen.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shell/browser/api/electron_api_screen.cc b/shell/browser/api/electron_api_screen.cc index 5b7f901c2a49..773653c6b9e6 100644 --- a/shell/browser/api/electron_api_screen.cc +++ b/shell/browser/api/electron_api_screen.cc @@ -14,6 +14,7 @@ #include "shell/common/gin_converters/callback_converter.h" #include "shell/common/gin_converters/gfx_converter.h" #include "shell/common/gin_converters/native_window_converter.h" +#include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/object_template_builder.h" #include "shell/common/node_includes.h" #include "ui/display/display.h" @@ -184,8 +185,8 @@ void Initialize(v8::Local exports, v8::Local context, void* priv) { v8::Isolate* isolate = context->GetIsolate(); - gin::Dictionary dict(isolate, exports); - dict.Set("createScreen", base::BindRepeating(&Screen::Create)); + gin_helper::Dictionary dict(isolate, exports); + dict.SetMethod("createScreen", base::BindRepeating(&Screen::Create)); dict.Set( "Screen", Screen::GetConstructor(isolate)->GetFunction(context).ToLocalChecked());