Exception in yFiles class framework in Safari 10
TroubleshootingSummary
With Safari 10 it can happen that a `TypeError: Attempting to change access mechanism for an unconfigurable property.` is thrown when a custom class is declared using the yfiles class framework in non strict mode.
Description
Safari changed the strict-mode implementation with version 10. Earlier versions of Safari are not affected by this bug.
Declaring a custom class with a constructor function using the yFiles class framework, the class cannot be initialized when the class declaration was executed in non-strict code.
The workaround to this issue is to declare the class in strict mode like this:
yfiles.module("test", function (exports) {
"use strict"; //enable strict-mode for the code inside the module!
exports.Test = new yfiles.lang.ClassDefinition(function () {
return {
'constructor': function () {
}
};
});
});
All version of yFiles for HTML up to 2.0.1.1 are affected. Newer versions will contain a workaround to this limitation in Safari 10.
Categories this article belongs to:
yFiles for HTML > Other
Applies to:
yFiles for HTML: 2.0
Keywords:
Safari - bug - class - constructor - unconfigurable - known issue