Set _setDeprecatedOptionsCheck on exports

This commit is contained in:
Kevin Sawicki 2016-03-18 09:06:03 -07:00
parent 7668c1ea0b
commit 6aa452cda4
2 changed files with 4 additions and 5 deletions

View file

@ -832,12 +832,11 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
&mate::TrackableObject<Window>::FromWeakMapID); &mate::TrackableObject<Window>::FromWeakMapID);
browser_window.SetMethod("getAllWindows", browser_window.SetMethod("getAllWindows",
&mate::TrackableObject<Window>::GetAll); &mate::TrackableObject<Window>::GetAll);
browser_window.SetMethod("_setDeprecatedOptionsCheck",
&atom::api::SetDeprecatedOptionsCheck);
mate::Dictionary dict(isolate, exports); mate::Dictionary dict(isolate, exports);
dict.Set("BrowserWindow", browser_window); dict.Set("BrowserWindow", browser_window);
dict.SetMethod("_setDeprecatedOptionsCheck",
&atom::api::SetDeprecatedOptionsCheck);
} }
} // namespace } // namespace

View file

@ -3,7 +3,7 @@
const ipcMain = require('electron').ipcMain; const ipcMain = require('electron').ipcMain;
const deprecate = require('electron').deprecate; const deprecate = require('electron').deprecate;
const EventEmitter = require('events').EventEmitter; const EventEmitter = require('events').EventEmitter;
const BrowserWindow = process.atomBinding('window').BrowserWindow; const {BrowserWindow, _setDeprecatedOptionsCheck} = process.atomBinding('window');
BrowserWindow.prototype.__proto__ = EventEmitter.prototype; BrowserWindow.prototype.__proto__ = EventEmitter.prototype;
@ -289,6 +289,6 @@ const checkForDeprecatedOptions = function(options) {
return ''; return '';
}; };
BrowserWindow._setDeprecatedOptionsCheck(checkForDeprecatedOptions); _setDeprecatedOptionsCheck(checkForDeprecatedOptions);
module.exports = BrowserWindow; module.exports = BrowserWindow;