Enable running the cmap unit-tests on Travis by utilizing a NodeCMapReaderFactory

This commit is contained in:
Jonas Jenwald 2017-02-17 13:44:49 +01:00
parent cfaa621a05
commit 9082f08e37
5 changed files with 108 additions and 20 deletions

View file

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals global */
/* globals global, process, __pdfjsdev_webpack__ */
'use strict';
@ -1136,6 +1136,14 @@ function isSpace(ch) {
return (ch === 0x20 || ch === 0x09 || ch === 0x0D || ch === 0x0A);
}
function isNodeJS() {
// The if below protected by __pdfjsdev_webpack__ check from webpack parsing.
if (typeof __pdfjsdev_webpack__ === 'undefined') {
return typeof process === 'object' && process + '' === '[object process]';
}
return false;
}
/**
* Promise Capability object.
*
@ -2454,6 +2462,7 @@ exports.isInt = isInt;
exports.isNum = isNum;
exports.isString = isString;
exports.isSpace = isSpace;
exports.isNodeJS = isNodeJS;
exports.isSameOrigin = isSameOrigin;
exports.createValidAbsoluteUrl = createValidAbsoluteUrl;
exports.isLittleEndian = isLittleEndian;