pdfjs-dist 2.0.489 → 2.2.228
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pdfjs-dist might be problematic. Click here for more details.
- package/CODE_OF_CONDUCT.md +15 -0
- package/bower.json +1 -1
- package/build/pdf.js +18515 -11402
- package/build/pdf.js.map +1 -1
- package/build/pdf.min.js +1 -1
- package/build/pdf.worker.js +48266 -37137
- package/build/pdf.worker.js.map +1 -1
- package/build/pdf.worker.min.js +1 -1
- package/external/url/url-lib.js +627 -0
- package/image_decoders/pdf.image_decoders.js +11350 -0
- package/image_decoders/pdf.image_decoders.js.map +1 -0
- package/image_decoders/pdf.image_decoders.min.js +1 -0
- package/lib/core/annotation.js +587 -242
- package/lib/core/arithmetic_decoder.js +275 -245
- package/lib/core/bidi.js +65 -6
- package/lib/core/ccitt.js +173 -18
- package/lib/core/ccitt_stream.js +15 -6
- package/lib/core/cff_parser.js +433 -61
- package/lib/core/charsets.js +5 -4
- package/lib/core/chunked_stream.js +400 -152
- package/lib/core/cmap.js +326 -87
- package/lib/core/colorspace.js +874 -594
- package/lib/core/core_utils.js +147 -0
- package/lib/core/crypto.js +290 -45
- package/lib/core/document.js +560 -268
- package/lib/core/encodings.js +19 -10
- package/lib/core/evaluator.js +1005 -360
- package/lib/core/font_renderer.js +331 -97
- package/lib/core/fonts.js +812 -195
- package/lib/core/function.js +284 -71
- package/lib/core/glyphlist.js +4 -3
- package/lib/core/image.js +169 -62
- package/lib/core/image_utils.js +111 -0
- package/lib/core/jbig2.js +479 -66
- package/lib/core/jbig2_stream.js +19 -8
- package/lib/core/jpeg_stream.js +38 -13
- package/lib/core/jpg.js +253 -29
- package/lib/core/jpx.js +396 -6
- package/lib/core/jpx_stream.js +18 -6
- package/lib/core/metrics.js +15 -15
- package/lib/core/murmurhash3.js +56 -34
- package/lib/core/obj.js +1354 -488
- package/lib/core/operator_list.js +144 -31
- package/lib/core/parser.js +539 -191
- package/lib/core/pattern.js +148 -14
- package/lib/core/pdf_manager.js +323 -133
- package/lib/core/primitives.js +111 -24
- package/lib/core/ps_parser.js +134 -45
- package/lib/core/standard_fonts.js +17 -17
- package/lib/core/stream.js +313 -34
- package/lib/core/type1_parser.js +143 -13
- package/lib/core/unicode.js +32 -5
- package/lib/core/worker.js +217 -190
- package/lib/core/worker_stream.js +277 -0
- package/lib/display/annotation_layer.js +450 -133
- package/lib/display/api.js +1597 -784
- package/lib/display/api_compatibility.js +11 -13
- package/lib/display/canvas.js +360 -44
- package/lib/display/content_disposition.js +83 -32
- package/lib/display/display_utils.js +747 -0
- package/lib/display/fetch_stream.js +221 -90
- package/lib/display/font_loader.js +468 -236
- package/lib/display/metadata.js +38 -16
- package/lib/display/network.js +635 -428
- package/lib/display/network_utils.js +32 -19
- package/lib/display/node_stream.js +367 -175
- package/lib/display/pattern_helper.js +81 -31
- package/lib/display/svg.js +1235 -519
- package/lib/display/text_layer.js +153 -29
- package/lib/display/transport_stream.js +345 -94
- package/lib/display/webgl.js +64 -18
- package/lib/display/worker_options.js +5 -4
- package/lib/display/xml_parser.js +166 -53
- package/lib/examples/node/domstubs.js +60 -4
- package/lib/pdf.js +36 -14
- package/lib/pdf.worker.js +5 -3
- package/lib/shared/compatibility.js +158 -564
- package/lib/shared/global_scope.js +2 -2
- package/lib/shared/is_node.js +4 -4
- package/lib/shared/message_handler.js +521 -0
- package/lib/shared/streams_polyfill.js +21 -17
- package/lib/shared/url_polyfill.js +56 -0
- package/lib/shared/util.js +243 -710
- package/lib/test/unit/annotation_spec.js +870 -401
- package/lib/test/unit/api_spec.js +657 -345
- package/lib/test/unit/bidi_spec.js +7 -7
- package/lib/test/unit/cff_parser_spec.js +54 -11
- package/lib/test/unit/clitests_helper.js +10 -8
- package/lib/test/unit/cmap_spec.js +95 -41
- package/lib/test/unit/colorspace_spec.js +115 -63
- package/lib/test/unit/core_utils_spec.js +191 -0
- package/lib/test/unit/crypto_spec.js +17 -5
- package/lib/test/unit/custom_spec.js +43 -55
- package/lib/test/unit/display_svg_spec.js +34 -18
- package/lib/test/unit/display_utils_spec.js +273 -0
- package/lib/test/unit/document_spec.js +8 -13
- package/lib/test/unit/encodings_spec.js +25 -45
- package/lib/test/unit/evaluator_spec.js +38 -15
- package/lib/test/unit/fetch_stream_spec.js +109 -0
- package/lib/test/unit/function_spec.js +17 -5
- package/lib/test/unit/jasmine-boot.js +33 -20
- package/lib/test/unit/{util_stream_spec.js → message_handler_spec.js} +41 -69
- package/lib/test/unit/metadata_spec.js +71 -11
- package/lib/test/unit/murmurhash3_spec.js +3 -3
- package/lib/test/unit/network_spec.js +19 -54
- package/lib/test/unit/network_utils_spec.js +91 -14
- package/lib/test/unit/node_stream_spec.js +56 -32
- package/lib/test/unit/parser_spec.js +162 -71
- package/lib/test/unit/pdf_find_controller_spec.js +230 -0
- package/lib/test/unit/pdf_find_utils_spec.js +63 -0
- package/lib/test/unit/pdf_history_spec.js +21 -9
- package/lib/test/unit/primitives_spec.js +53 -20
- package/lib/test/unit/stream_spec.js +12 -4
- package/lib/test/unit/test_utils.js +273 -56
- package/lib/test/unit/testreporter.js +21 -3
- package/lib/test/unit/type1_parser_spec.js +8 -6
- package/lib/test/unit/ui_utils_spec.js +454 -16
- package/lib/test/unit/unicode_spec.js +18 -15
- package/lib/test/unit/util_spec.js +87 -128
- package/lib/web/annotation_layer_builder.js +39 -22
- package/lib/web/app.js +1290 -588
- package/lib/web/app_options.js +100 -62
- package/lib/web/base_viewer.js +511 -182
- package/lib/web/chromecom.js +261 -117
- package/lib/web/debugger.js +166 -22
- package/lib/web/download_manager.js +32 -13
- package/lib/web/firefox_print_service.js +20 -10
- package/lib/web/firefoxcom.js +315 -80
- package/lib/web/genericcom.js +89 -30
- package/lib/web/genericl10n.js +142 -30
- package/lib/web/grab_to_pan.js +28 -4
- package/lib/web/interfaces.js +170 -47
- package/lib/web/overlay_manager.js +235 -85
- package/lib/web/password_prompt.js +22 -14
- package/lib/web/pdf_attachment_viewer.js +38 -18
- package/lib/web/pdf_cursor_tools.js +39 -16
- package/lib/web/pdf_document_properties.js +255 -136
- package/lib/web/pdf_find_bar.js +84 -40
- package/lib/web/pdf_find_controller.js +495 -184
- package/lib/web/pdf_find_utils.js +111 -0
- package/lib/web/pdf_history.js +190 -53
- package/lib/web/pdf_link_service.js +138 -77
- package/lib/web/pdf_outline_viewer.js +122 -46
- package/lib/web/pdf_page_view.js +191 -67
- package/lib/web/pdf_presentation_mode.js +99 -34
- package/lib/web/pdf_print_service.js +61 -13
- package/lib/web/pdf_rendering_queue.js +28 -9
- package/lib/web/pdf_sidebar.js +141 -81
- package/lib/web/pdf_sidebar_resizer.js +42 -16
- package/lib/web/pdf_single_page_viewer.js +74 -66
- package/lib/web/pdf_thumbnail_view.js +104 -33
- package/lib/web/pdf_thumbnail_viewer.js +66 -26
- package/lib/web/pdf_viewer.component.js +112 -32
- package/lib/web/pdf_viewer.js +91 -52
- package/lib/web/preferences.js +284 -89
- package/lib/web/secondary_toolbar.js +165 -40
- package/lib/web/text_layer_builder.js +134 -59
- package/lib/web/toolbar.js +78 -43
- package/lib/web/ui_utils.js +462 -136
- package/lib/web/view_history.js +215 -67
- package/lib/web/viewer_compatibility.js +4 -13
- package/package.json +5 -4
- package/web/pdf_viewer.css +79 -11
- package/web/pdf_viewer.js +6107 -3748
- package/web/pdf_viewer.js.map +1 -1
- package/lib/display/dom_utils.js +0 -309
- package/lib/test/unit/dom_utils_spec.js +0 -89
- package/lib/test/unit/fonts_spec.js +0 -81
- package/lib/web/dom_events.js +0 -137
package/lib/web/preferences.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -24,44 +24,59 @@
|
|
24
24
|
Object.defineProperty(exports, "__esModule", {
|
25
25
|
value: true
|
26
26
|
});
|
27
|
-
exports.BasePreferences =
|
27
|
+
exports.BasePreferences = void 0;
|
28
28
|
|
29
|
-
var
|
29
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
30
30
|
|
31
|
-
|
31
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
32
32
|
|
33
|
-
var
|
33
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
34
|
+
|
35
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
36
|
+
|
37
|
+
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
34
38
|
|
35
39
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
36
40
|
|
41
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
42
|
+
|
43
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
44
|
+
|
37
45
|
var defaultPreferences = null;
|
46
|
+
|
38
47
|
function getDefaultPreferences() {
|
39
48
|
if (!defaultPreferences) {
|
40
49
|
defaultPreferences = Promise.resolve({
|
41
|
-
"showPreviousViewOnLoad": true,
|
42
|
-
"defaultZoomValue": "",
|
43
|
-
"sidebarViewOnLoad": 0,
|
44
50
|
"cursorToolOnLoad": 0,
|
51
|
+
"defaultZoomValue": "",
|
52
|
+
"disablePageLabels": false,
|
53
|
+
"enablePrintAutoRotate": false,
|
45
54
|
"enableWebGL": false,
|
46
|
-
"
|
47
|
-
"disableRange": false,
|
48
|
-
"disableStream": false,
|
49
|
-
"disableAutoFetch": false,
|
50
|
-
"disableFontFace": false,
|
51
|
-
"textLayerMode": 1,
|
52
|
-
"useOnlyCssZoom": false,
|
55
|
+
"eventBusDispatchToDOM": false,
|
53
56
|
"externalLinkTarget": 0,
|
57
|
+
"historyUpdateUrl": false,
|
58
|
+
"pdfBugEnabled": false,
|
54
59
|
"renderer": "canvas",
|
55
60
|
"renderInteractiveForms": false,
|
56
|
-
"
|
57
|
-
"
|
58
|
-
"
|
61
|
+
"sidebarViewOnLoad": -1,
|
62
|
+
"scrollModeOnLoad": -1,
|
63
|
+
"spreadModeOnLoad": -1,
|
64
|
+
"textLayerMode": 1,
|
65
|
+
"useOnlyCssZoom": false,
|
66
|
+
"viewOnLoad": 0,
|
67
|
+
"disableAutoFetch": false,
|
68
|
+
"disableFontFace": false,
|
69
|
+
"disableRange": false,
|
70
|
+
"disableStream": false
|
59
71
|
});
|
60
72
|
}
|
73
|
+
|
61
74
|
return defaultPreferences;
|
62
75
|
}
|
63
76
|
|
64
|
-
var BasePreferences =
|
77
|
+
var BasePreferences =
|
78
|
+
/*#__PURE__*/
|
79
|
+
function () {
|
65
80
|
function BasePreferences() {
|
66
81
|
var _this = this;
|
67
82
|
|
@@ -70,6 +85,7 @@ var BasePreferences = function () {
|
|
70
85
|
if (this.constructor === BasePreferences) {
|
71
86
|
throw new Error('Cannot initialize BasePreferences.');
|
72
87
|
}
|
88
|
+
|
73
89
|
this.prefs = null;
|
74
90
|
this._initializedPromise = getDefaultPreferences().then(function (defaults) {
|
75
91
|
Object.defineProperty(_this, 'defaults', {
|
@@ -78,94 +94,273 @@ var BasePreferences = function () {
|
|
78
94
|
enumerable: true,
|
79
95
|
configurable: false
|
80
96
|
});
|
81
|
-
_this.prefs = (
|
97
|
+
_this.prefs = Object.assign(Object.create(null), defaults);
|
82
98
|
return _this._readFromStorage(defaults);
|
83
|
-
}).then(function (
|
84
|
-
if (
|
85
|
-
|
99
|
+
}).then(function (prefs) {
|
100
|
+
if (!prefs) {
|
101
|
+
return;
|
102
|
+
}
|
103
|
+
|
104
|
+
for (var name in prefs) {
|
105
|
+
var defaultValue = _this.defaults[name],
|
106
|
+
prefValue = prefs[name];
|
107
|
+
|
108
|
+
if (defaultValue === undefined || _typeof(prefValue) !== _typeof(defaultValue)) {
|
109
|
+
continue;
|
110
|
+
}
|
111
|
+
|
112
|
+
_this.prefs[name] = prefValue;
|
86
113
|
}
|
87
114
|
});
|
88
115
|
}
|
89
116
|
|
90
117
|
_createClass(BasePreferences, [{
|
91
118
|
key: "_writeToStorage",
|
92
|
-
value: function
|
93
|
-
|
94
|
-
|
119
|
+
value: function () {
|
120
|
+
var _writeToStorage2 = _asyncToGenerator(
|
121
|
+
/*#__PURE__*/
|
122
|
+
_regenerator["default"].mark(function _callee(prefObj) {
|
123
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
124
|
+
while (1) {
|
125
|
+
switch (_context.prev = _context.next) {
|
126
|
+
case 0:
|
127
|
+
throw new Error('Not implemented: _writeToStorage');
|
128
|
+
|
129
|
+
case 1:
|
130
|
+
case "end":
|
131
|
+
return _context.stop();
|
132
|
+
}
|
133
|
+
}
|
134
|
+
}, _callee);
|
135
|
+
}));
|
136
|
+
|
137
|
+
function _writeToStorage(_x) {
|
138
|
+
return _writeToStorage2.apply(this, arguments);
|
139
|
+
}
|
140
|
+
|
141
|
+
return _writeToStorage;
|
142
|
+
}()
|
95
143
|
}, {
|
96
144
|
key: "_readFromStorage",
|
97
|
-
value: function
|
98
|
-
|
99
|
-
|
145
|
+
value: function () {
|
146
|
+
var _readFromStorage2 = _asyncToGenerator(
|
147
|
+
/*#__PURE__*/
|
148
|
+
_regenerator["default"].mark(function _callee2(prefObj) {
|
149
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
150
|
+
while (1) {
|
151
|
+
switch (_context2.prev = _context2.next) {
|
152
|
+
case 0:
|
153
|
+
throw new Error('Not implemented: _readFromStorage');
|
154
|
+
|
155
|
+
case 1:
|
156
|
+
case "end":
|
157
|
+
return _context2.stop();
|
158
|
+
}
|
159
|
+
}
|
160
|
+
}, _callee2);
|
161
|
+
}));
|
162
|
+
|
163
|
+
function _readFromStorage(_x2) {
|
164
|
+
return _readFromStorage2.apply(this, arguments);
|
165
|
+
}
|
166
|
+
|
167
|
+
return _readFromStorage;
|
168
|
+
}()
|
100
169
|
}, {
|
101
170
|
key: "reset",
|
102
|
-
value: function
|
103
|
-
var
|
171
|
+
value: function () {
|
172
|
+
var _reset = _asyncToGenerator(
|
173
|
+
/*#__PURE__*/
|
174
|
+
_regenerator["default"].mark(function _callee3() {
|
175
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
176
|
+
while (1) {
|
177
|
+
switch (_context3.prev = _context3.next) {
|
178
|
+
case 0:
|
179
|
+
_context3.next = 2;
|
180
|
+
return this._initializedPromise;
|
104
181
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
}
|
182
|
+
case 2:
|
183
|
+
this.prefs = Object.assign(Object.create(null), this.defaults);
|
184
|
+
return _context3.abrupt("return", this._writeToStorage(this.defaults));
|
185
|
+
|
186
|
+
case 4:
|
187
|
+
case "end":
|
188
|
+
return _context3.stop();
|
189
|
+
}
|
190
|
+
}
|
191
|
+
}, _callee3, this);
|
192
|
+
}));
|
193
|
+
|
194
|
+
function reset() {
|
195
|
+
return _reset.apply(this, arguments);
|
196
|
+
}
|
197
|
+
|
198
|
+
return reset;
|
199
|
+
}()
|
123
200
|
}, {
|
124
201
|
key: "set",
|
125
|
-
value: function
|
126
|
-
var
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
202
|
+
value: function () {
|
203
|
+
var _set = _asyncToGenerator(
|
204
|
+
/*#__PURE__*/
|
205
|
+
_regenerator["default"].mark(function _callee4(name, value) {
|
206
|
+
var defaultValue, valueType, defaultType;
|
207
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
208
|
+
while (1) {
|
209
|
+
switch (_context4.prev = _context4.next) {
|
210
|
+
case 0:
|
211
|
+
_context4.next = 2;
|
212
|
+
return this._initializedPromise;
|
213
|
+
|
214
|
+
case 2:
|
215
|
+
defaultValue = this.defaults[name];
|
216
|
+
|
217
|
+
if (!(defaultValue === undefined)) {
|
218
|
+
_context4.next = 7;
|
219
|
+
break;
|
220
|
+
}
|
221
|
+
|
222
|
+
throw new Error("Set preference: \"".concat(name, "\" is undefined."));
|
223
|
+
|
224
|
+
case 7:
|
225
|
+
if (!(value === undefined)) {
|
226
|
+
_context4.next = 9;
|
227
|
+
break;
|
228
|
+
}
|
229
|
+
|
230
|
+
throw new Error('Set preference: no value is specified.');
|
231
|
+
|
232
|
+
case 9:
|
233
|
+
valueType = _typeof(value);
|
234
|
+
defaultType = _typeof(defaultValue);
|
235
|
+
|
236
|
+
if (!(valueType !== defaultType)) {
|
237
|
+
_context4.next = 19;
|
238
|
+
break;
|
239
|
+
}
|
240
|
+
|
241
|
+
if (!(valueType === 'number' && defaultType === 'string')) {
|
242
|
+
_context4.next = 16;
|
243
|
+
break;
|
244
|
+
}
|
245
|
+
|
246
|
+
value = value.toString();
|
247
|
+
_context4.next = 17;
|
248
|
+
break;
|
249
|
+
|
250
|
+
case 16:
|
251
|
+
throw new Error("Set preference: \"".concat(value, "\" is a ").concat(valueType, ", ") + "expected a ".concat(defaultType, "."));
|
252
|
+
|
253
|
+
case 17:
|
254
|
+
_context4.next = 21;
|
255
|
+
break;
|
256
|
+
|
257
|
+
case 19:
|
258
|
+
if (!(valueType === 'number' && !Number.isInteger(value))) {
|
259
|
+
_context4.next = 21;
|
260
|
+
break;
|
261
|
+
}
|
262
|
+
|
263
|
+
throw new Error("Set preference: \"".concat(value, "\" must be an integer."));
|
264
|
+
|
265
|
+
case 21:
|
266
|
+
this.prefs[name] = value;
|
267
|
+
return _context4.abrupt("return", this._writeToStorage(this.prefs));
|
268
|
+
|
269
|
+
case 23:
|
270
|
+
case "end":
|
271
|
+
return _context4.stop();
|
272
|
+
}
|
145
273
|
}
|
146
|
-
}
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
274
|
+
}, _callee4, this);
|
275
|
+
}));
|
276
|
+
|
277
|
+
function set(_x3, _x4) {
|
278
|
+
return _set.apply(this, arguments);
|
279
|
+
}
|
280
|
+
|
281
|
+
return set;
|
282
|
+
}()
|
151
283
|
}, {
|
152
284
|
key: "get",
|
153
|
-
value: function
|
154
|
-
var
|
155
|
-
|
156
|
-
|
157
|
-
var defaultValue
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
285
|
+
value: function () {
|
286
|
+
var _get = _asyncToGenerator(
|
287
|
+
/*#__PURE__*/
|
288
|
+
_regenerator["default"].mark(function _callee5(name) {
|
289
|
+
var defaultValue, prefValue;
|
290
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
291
|
+
while (1) {
|
292
|
+
switch (_context5.prev = _context5.next) {
|
293
|
+
case 0:
|
294
|
+
_context5.next = 2;
|
295
|
+
return this._initializedPromise;
|
296
|
+
|
297
|
+
case 2:
|
298
|
+
defaultValue = this.defaults[name];
|
299
|
+
|
300
|
+
if (!(defaultValue === undefined)) {
|
301
|
+
_context5.next = 7;
|
302
|
+
break;
|
303
|
+
}
|
304
|
+
|
305
|
+
throw new Error("Get preference: \"".concat(name, "\" is undefined."));
|
306
|
+
|
307
|
+
case 7:
|
308
|
+
prefValue = this.prefs[name];
|
309
|
+
|
310
|
+
if (!(prefValue !== undefined)) {
|
311
|
+
_context5.next = 10;
|
312
|
+
break;
|
313
|
+
}
|
314
|
+
|
315
|
+
return _context5.abrupt("return", prefValue);
|
316
|
+
|
317
|
+
case 10:
|
318
|
+
return _context5.abrupt("return", defaultValue);
|
319
|
+
|
320
|
+
case 11:
|
321
|
+
case "end":
|
322
|
+
return _context5.stop();
|
323
|
+
}
|
164
324
|
}
|
165
|
-
}
|
166
|
-
|
167
|
-
|
168
|
-
|
325
|
+
}, _callee5, this);
|
326
|
+
}));
|
327
|
+
|
328
|
+
function get(_x5) {
|
329
|
+
return _get.apply(this, arguments);
|
330
|
+
}
|
331
|
+
|
332
|
+
return get;
|
333
|
+
}()
|
334
|
+
}, {
|
335
|
+
key: "getAll",
|
336
|
+
value: function () {
|
337
|
+
var _getAll = _asyncToGenerator(
|
338
|
+
/*#__PURE__*/
|
339
|
+
_regenerator["default"].mark(function _callee6() {
|
340
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
341
|
+
while (1) {
|
342
|
+
switch (_context6.prev = _context6.next) {
|
343
|
+
case 0:
|
344
|
+
_context6.next = 2;
|
345
|
+
return this._initializedPromise;
|
346
|
+
|
347
|
+
case 2:
|
348
|
+
return _context6.abrupt("return", Object.assign(Object.create(null), this.defaults, this.prefs));
|
349
|
+
|
350
|
+
case 3:
|
351
|
+
case "end":
|
352
|
+
return _context6.stop();
|
353
|
+
}
|
354
|
+
}
|
355
|
+
}, _callee6, this);
|
356
|
+
}));
|
357
|
+
|
358
|
+
function getAll() {
|
359
|
+
return _getAll.apply(this, arguments);
|
360
|
+
}
|
361
|
+
|
362
|
+
return getAll;
|
363
|
+
}()
|
169
364
|
}]);
|
170
365
|
|
171
366
|
return BasePreferences;
|