зеркало из https://github.com/electron/electron.git
Improve deprecated message on webPreferences options
This commit is contained in:
Родитель
c31882749d
Коммит
737ffd8d7c
|
@ -280,7 +280,7 @@ const checkForDeprecatedOptions = function(options) {
|
|||
}
|
||||
if (webPreferenceOption) {
|
||||
try {
|
||||
deprecate.log(`Setting ${webPreferenceOption} on options is deprecated. Set it on options.webPreferences instead.`);
|
||||
deprecate.log(`options.${webPreferenceOption} is deprecated. Use options.webPreferences.${webPreferenceOption} instead.`);
|
||||
} catch (error) {
|
||||
// Return error message so it can be rethrown via C++
|
||||
return error.message;
|
||||
|
|
|
@ -776,7 +776,7 @@ describe('browser-window module', function() {
|
|||
it('throws a deprecation error for option keys that should be set on webPreferences', function() {
|
||||
assert.throws(function () {
|
||||
new BrowserWindow({zoomFactor: 1});
|
||||
}, 'Setting zoomFactor on options is deprecated. Set it on options.webPreferences instead.');
|
||||
}, 'options.zoomFactor is deprecated. Use options.webPreferences.zoomFactor instead.');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче