Chromium throw an error on calling defineProperty on a getter only
This commit is contained in:
parent
763bd7059a
commit
c7195a4450
24
pdf.js
24
pdf.js
@ -55,11 +55,17 @@ function backtrace() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function shadow(obj, prop, value) {
|
function shadow(obj, prop, value) {
|
||||||
Object.defineProperty(obj, prop, { value: value,
|
try {
|
||||||
enumerable: true,
|
Object.defineProperty(obj, prop, { value: value,
|
||||||
configurable: true,
|
enumerable: true,
|
||||||
writable: false });
|
configurable: true,
|
||||||
return value;
|
writable: false });
|
||||||
|
} catch(e) {
|
||||||
|
obj.__defineGetter__(prop, function() {
|
||||||
|
return value;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
function bytesToString(bytes) {
|
function bytesToString(bytes) {
|
||||||
@ -4275,6 +4281,10 @@ var PartialEvaluator = (function() {
|
|||||||
case 'Type1':
|
case 'Type1':
|
||||||
baseEncoding = Encodings.StandardEncoding.slice();
|
baseEncoding = Encodings.StandardEncoding.slice();
|
||||||
break;
|
break;
|
||||||
|
case 'Type3':
|
||||||
|
// There is no baseEncoding for a Type3 font, the 'Encoding'
|
||||||
|
// entry is required and should provide a complete encoding
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
warn('Unknown type of font: ' + fontType);
|
warn('Unknown type of font: ' + fontType);
|
||||||
break;
|
break;
|
||||||
@ -4298,6 +4308,10 @@ var PartialEvaluator = (function() {
|
|||||||
glyphsMap[glyph] = encodingMap[i] = GlyphsUnicode[glyph] || i;
|
glyphsMap[glyph] = encodingMap[i] = GlyphsUnicode[glyph] || i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (fontType == 'Type3')
|
||||||
|
log(glyphsMap);
|
||||||
|
|
||||||
if (fontType == 'TrueType' && fontDict.has('ToUnicode') && differences) {
|
if (fontType == 'TrueType' && fontDict.has('ToUnicode') && differences) {
|
||||||
var cmapObj = xref.fetchIfRef(fontDict.get('ToUnicode'));
|
var cmapObj = xref.fetchIfRef(fontDict.get('ToUnicode'));
|
||||||
if (IsName(cmapObj)) {
|
if (IsName(cmapObj)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user