Browse Source

fix: screen module should still be creatable if the first create is before the ready event (#22913)

Co-authored-by: Samuel Attard <[email protected]>
trop[bot] 5 years ago
parent
commit
2c4c1a3dd9
1 changed files with 3 additions and 2 deletions
  1. 3 2
      shell/browser/api/electron_api_screen.cc

+ 3 - 2
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<v8::Object> exports,
                 v8::Local<v8::Context> 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());