1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 17:48:07 +02:00

Update Prettier to version 2.0

Please note that these changes were done automatically, using `gulp lint --fix`.

Given that the major version number was increased, there's a fair number of (primarily whitespace) changes; please see https://prettier.io/blog/2020/03/21/2.0.0.html
In order to reduce the size of these changes somewhat, this patch maintains the old "arrowParens" style for now (once mozilla-central updates Prettier we can simply choose the same formatting, assuming it will differ here).
This commit is contained in:
Jonas Jenwald 2020-04-14 12:28:14 +02:00
parent a4dd081d7b
commit 426945b480
145 changed files with 2005 additions and 2009 deletions

View file

@ -530,7 +530,7 @@ var BinaryCMapReader = (function BinaryCMapReaderClosure() {
};
function processBinaryCMap(data, cMap, extend) {
return new Promise(function(resolve, reject) {
return new Promise(function (resolve, reject) {
var stream = new BinaryCMapStream(data);
var header = stream.readByte();
cMap.vertical = !!(header & 1);
@ -934,7 +934,9 @@ var CMapFactory = (function CMapFactoryClosure() {
}
function extendCMap(cMap, fetchBuiltInCMap, useCMap) {
return createBuiltInCMap(useCMap, fetchBuiltInCMap).then(function(newCMap) {
return createBuiltInCMap(useCMap, fetchBuiltInCMap).then(function (
newCMap
) {
cMap.useCMap = newCMap;
// If there aren't any code space ranges defined clone all the parent ones
// into this cMap.
@ -947,7 +949,7 @@ var CMapFactory = (function CMapFactoryClosure() {
}
// Merge the map into the current one, making sure not to override
// any previously defined entries.
cMap.useCMap.forEach(function(key, value) {
cMap.useCMap.forEach(function (key, value) {
if (!cMap.contains(key)) {
cMap.mapOne(key, cMap.useCMap.lookup(key));
}
@ -972,13 +974,13 @@ var CMapFactory = (function CMapFactoryClosure() {
);
}
return fetchBuiltInCMap(name).then(function(data) {
return fetchBuiltInCMap(name).then(function (data) {
var cMapData = data.cMapData,
compressionType = data.compressionType;
var cMap = new CMap(true);
if (compressionType === CMapCompressionType.BINARY) {
return new BinaryCMapReader().process(cMapData, cMap, function(
return new BinaryCMapReader().process(cMapData, cMap, function (
useCMap
) {
return extendCMap(cMap, fetchBuiltInCMap, useCMap);
@ -1007,7 +1009,7 @@ var CMapFactory = (function CMapFactoryClosure() {
} else if (isStream(encoding)) {
var cMap = new CMap();
var lexer = new Lexer(encoding);
return parseCMap(cMap, lexer, fetchBuiltInCMap, useCMap).then(function(
return parseCMap(cMap, lexer, fetchBuiltInCMap, useCMap).then(function (
parsedCMap
) {
if (parsedCMap.isIdentityCMap) {