Add a getArrayLookupTableFactory
helper function and use it to re-format src/core/{glyphlist, unicode}.js
*Please note:* Once https://bugzilla.mozilla.org/show_bug.cgi?id=1247687 is implemented, and we've removed SystemJS completely, this entire patch can (and even should) be reverted. This is similar to the existing `getLookupTableFactory` helper function, but is implemented as outlined in issue 6774. The re-formatting of the tables were done automatically, by using find-and-replace with regular expressions. For reasons that I don't even pretend to understand, using this particular structure for these *very* long lookup tables allow SystemJS to process the files correctly/quickly and the development viewer thus works as intended.
This commit is contained in:
parent
441d9c8cc0
commit
56fa6d414c
@ -27,6 +27,22 @@ function getLookupTableFactory(initializer) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getArrayLookupTableFactory(initializer) {
|
||||||
|
let lookup;
|
||||||
|
return function () {
|
||||||
|
if (initializer) {
|
||||||
|
let arr = initializer();
|
||||||
|
initializer = null;
|
||||||
|
lookup = Object.create(null);
|
||||||
|
for (let i = 0, ii = arr.length; i < ii; i += 2) {
|
||||||
|
lookup[arr[i]] = arr[i + 1];
|
||||||
|
}
|
||||||
|
arr = null;
|
||||||
|
}
|
||||||
|
return lookup;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
class MissingDataException extends BaseException {
|
class MissingDataException extends BaseException {
|
||||||
constructor(begin, end) {
|
constructor(begin, end) {
|
||||||
super(`Missing data [${begin}, ${end})`);
|
super(`Missing data [${begin}, ${end})`);
|
||||||
@ -212,6 +228,7 @@ function escapePDFName(str) {
|
|||||||
export {
|
export {
|
||||||
escapePDFName,
|
escapePDFName,
|
||||||
getLookupTableFactory,
|
getLookupTableFactory,
|
||||||
|
getArrayLookupTableFactory,
|
||||||
MissingDataException,
|
MissingDataException,
|
||||||
XRefEntryException,
|
XRefEntryException,
|
||||||
XRefParseException,
|
XRefParseException,
|
||||||
|
File diff suppressed because it is too large
Load Diff
2764
src/core/unicode.js
2764
src/core/unicode.js
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user