mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-21 15:48:06 +02:00
Move MessageHandler
into a separate src/shared/message_handler.js
file
The `MessageHandler` itself, and its assorted helper functions, are currently the single largest[1] piece of code in the `src/shared/util.js` file. By moving this code into its own file, `src/shared/util.js` thus becomes smaller and more manageable.
This commit is contained in:
parent
69f2a77543
commit
44d8afd46b
7 changed files with 458 additions and 434 deletions
|
@ -20,6 +20,7 @@
|
|||
"evaluator_spec.js",
|
||||
"fonts_spec.js",
|
||||
"function_spec.js",
|
||||
"message_handler_spec.js",
|
||||
"metadata_spec.js",
|
||||
"murmurhash3_spec.js",
|
||||
"network_utils_spec.js",
|
||||
|
@ -31,7 +32,6 @@
|
|||
"type1_parser_spec.js",
|
||||
"ui_utils_spec.js",
|
||||
"unicode_spec.js",
|
||||
"util_spec.js",
|
||||
"util_stream_spec.js"
|
||||
"util_spec.js"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@ function initializePDFJS(callback) {
|
|||
'pdfjs-test/unit/evaluator_spec',
|
||||
'pdfjs-test/unit/fonts_spec',
|
||||
'pdfjs-test/unit/function_spec',
|
||||
'pdfjs-test/unit/message_handler_spec',
|
||||
'pdfjs-test/unit/metadata_spec',
|
||||
'pdfjs-test/unit/murmurhash3_spec',
|
||||
'pdfjs-test/unit/network_spec',
|
||||
|
@ -74,7 +75,6 @@ function initializePDFJS(callback) {
|
|||
'pdfjs-test/unit/ui_utils_spec',
|
||||
'pdfjs-test/unit/unicode_spec',
|
||||
'pdfjs-test/unit/util_spec',
|
||||
'pdfjs-test/unit/util_stream_spec',
|
||||
].map(function (moduleName) {
|
||||
return SystemJS.import(moduleName);
|
||||
})).then(function(modules) {
|
||||
|
|
|
@ -13,9 +13,10 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createPromiseCapability, MessageHandler } from '../../src/shared/util';
|
||||
import { createPromiseCapability } from '../../src/shared/util';
|
||||
import { MessageHandler } from '../../src/shared/message_handler';
|
||||
|
||||
describe('util_stream', function () {
|
||||
describe('message_handler', function () {
|
||||
// Temporary fake port for sending messages between main and worker.
|
||||
class FakePort {
|
||||
constructor() {
|
Loading…
Add table
Add a link
Reference in a new issue