зеркало из https://github.com/electron/electron.git
chore: clean up BrowserView/TopLevelWindow New impl (#19375)
* chore: clean up BrowserView::New impl * also default TL win options dict
This commit is contained in:
Родитель
5aa1385cfc
Коммит
c6bcf49acc
|
@ -102,15 +102,8 @@ mate::WrappableBase* BrowserView::New(mate::Arguments* args) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
if (args->Length() > 1) {
|
||||
args->ThrowError("Too many arguments");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
mate::Dictionary options;
|
||||
if (!(args->Length() == 1 && args->GetNext(&options))) {
|
||||
options = mate::Dictionary::CreateEmpty(args->isolate());
|
||||
}
|
||||
mate::Dictionary options = mate::Dictionary::CreateEmpty(args->isolate());
|
||||
args->GetNext(&options);
|
||||
|
||||
return new BrowserView(args->isolate(), args->GetThis(), options);
|
||||
}
|
||||
|
|
|
@ -1030,9 +1030,9 @@ void TopLevelWindow::RemoveFromParentChildWindows() {
|
|||
|
||||
// static
|
||||
mate::WrappableBase* TopLevelWindow::New(mate::Arguments* args) {
|
||||
mate::Dictionary options;
|
||||
if (!(args->Length() == 1 && args->GetNext(&options)))
|
||||
options = mate::Dictionary::CreateEmpty(args->isolate());
|
||||
mate::Dictionary options = mate::Dictionary::CreateEmpty(args->isolate());
|
||||
args->GetNext(&options);
|
||||
|
||||
return new TopLevelWindow(args->isolate(), args->GetThis(), options);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче