mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Implement Bootstrap.js changes:
Fix Firefox support for beans through __defineGetter/Setter__. Fix redefinition of properties on Safari through call to delete first.
This commit is contained in:
parent
53d61cceb5
commit
b47e896389
1 changed files with 8 additions and 3 deletions
|
@ -44,10 +44,15 @@ new function() { // Bootstrap scope
|
||||||
|
|
||||||
function define(obj, name, desc) {
|
function define(obj, name, desc) {
|
||||||
if (_define)
|
if (_define)
|
||||||
try { return _define(obj, name, desc); } catch (e) {}
|
try {
|
||||||
|
// Fix Safari bug of redefining properties even if they are
|
||||||
|
// configurable
|
||||||
|
delete obj[name];
|
||||||
|
return _define(obj, name, desc);
|
||||||
|
} catch (e) {}
|
||||||
if ((desc.get || desc.set) && obj.__defineGetter__) {
|
if ((desc.get || desc.set) && obj.__defineGetter__) {
|
||||||
if (desc.get) obj.__defineGetter__(obj, desc.get);
|
if (desc.get) obj.__defineGetter__(name, desc.get);
|
||||||
if (desc.set) obj.__defineSetter__(obj, desc.set);
|
if (desc.set) obj.__defineSetter__(name, desc.set);
|
||||||
} else {
|
} else {
|
||||||
obj[name] = desc.value;
|
obj[name] = desc.value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue