The rewriteDescriptor function being called by the zone.js Object.defineProperty override is breaking some functionality of the popular jsPDF library: parallax/jsPDF#2429
I don't really understand why the rewriteDescriptor method changes the desc.configurable to true but it breaks several places in the jsPDF code where jsPDF tries to define non-configurable properties like this:
var _BBox = [];
Object.defineProperty(this, 'BBox', {
configurable: false,
writeable: true,
get: function () {
return _BBox;
},
set: function (value) {
_BBox = value;
}
});
It could be fixed by freezing the desc object in jsPDF like this:
var _BBox = [];
Object.defineProperty(this, 'BBox', Object.freeze({
configurable: false,
writeable: true,
get: function () {
return _BBox;
},
set: function (value) {
_BBox = value;
}
}));
However, the jsPDF maintainers make a good point when they ask why they should change their code when it's adhering to standard functionality. I really can't answer that as I don't know enough about zone.js but I hope someone here can help us get this figured out.
The rewriteDescriptor function being called by the zone.js Object.defineProperty override is breaking some functionality of the popular jsPDF library: parallax/jsPDF#2429
I don't really understand why the rewriteDescriptor method changes the desc.configurable to true but it breaks several places in the jsPDF code where jsPDF tries to define non-configurable properties like this:
It could be fixed by freezing the desc object in jsPDF like this:
However, the jsPDF maintainers make a good point when they ask why they should change their code when it's adhering to standard functionality. I really can't answer that as I don't know enough about zone.js but I hope someone here can help us get this figured out.