mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Replace the cloneObj
helper function, in the viewer, with native Object.assign
(PR 9795 follow-up)
This commit is contained in:
parent
40d577d7dd
commit
3c622ef048
4 changed files with 6 additions and 20 deletions
|
@ -13,8 +13,6 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { cloneObj } from './ui_utils';
|
||||
|
||||
let defaultPreferences = null;
|
||||
function getDefaultPreferences() {
|
||||
if (!defaultPreferences) {
|
||||
|
@ -60,7 +58,7 @@ class BasePreferences {
|
|||
configurable: false,
|
||||
});
|
||||
|
||||
this.prefs = cloneObj(defaults);
|
||||
this.prefs = Object.assign(Object.create(null), defaults);
|
||||
return this._readFromStorage(defaults);
|
||||
}).then((prefObj) => {
|
||||
if (prefObj) {
|
||||
|
@ -96,7 +94,7 @@ class BasePreferences {
|
|||
*/
|
||||
reset() {
|
||||
return this._initializedPromise.then(() => {
|
||||
this.prefs = cloneObj(this.defaults);
|
||||
this.prefs = Object.assign(Object.create(null), this.defaults);
|
||||
return this._writeToStorage(this.defaults);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue