mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Update to latest straps.js
Enabling paper.install(window) again.
This commit is contained in:
parent
6bb681b56d
commit
268003f241
1 changed files with 26 additions and 23 deletions
|
@ -45,29 +45,8 @@ var Base = new function() {
|
|||
// support Firefox 3.5 & 3.6, and this hack works there:
|
||||
return { __proto__: proto };
|
||||
},
|
||||
_define = Object.defineProperty || function(obj, name, desc) {
|
||||
// Emulate Object.defineProperty for outdated browsers
|
||||
if ((desc.get || desc.set) && obj.__defineGetter__) {
|
||||
if (desc.get)
|
||||
obj.__defineGetter__(name, desc.get);
|
||||
if (desc.set)
|
||||
obj.__defineSetter__(name, desc.set);
|
||||
} else {
|
||||
obj[name] = desc.value;
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
_describe = Object.getOwnPropertyDescriptor || function(obj, name) {
|
||||
// Emulate Object.getOwnPropertyDescriptor for outdated browsers
|
||||
var get = obj.__lookupGetter__ && obj.__lookupGetter__(name);
|
||||
return get
|
||||
? { get: get, set: obj.__lookupSetter__(name),
|
||||
enumerable: true, configurable: true }
|
||||
: obj.hasOwnProperty(name)
|
||||
? { value: obj[name], enumerable: true,
|
||||
configurable: true, writable: true }
|
||||
: null;
|
||||
};
|
||||
_define = Object.defineProperty,
|
||||
_describe = Object.getOwnPropertyDescriptor;
|
||||
|
||||
function define(obj, name, desc) {
|
||||
try {
|
||||
|
@ -76,12 +55,36 @@ var Base = new function() {
|
|||
delete obj[name];
|
||||
return _define(obj, name, desc);
|
||||
} catch (e) {}
|
||||
// Emulate Object.defineProperty for outdated browsers.
|
||||
// NOTE: We're also falling back on this scenario currently when the
|
||||
// above trigggers an exception, e.g. when using Base.define on the
|
||||
// window object.
|
||||
if ((desc.get || desc.set) && obj.__defineGetter__) {
|
||||
if (desc.get)
|
||||
obj.__defineGetter__(name, desc.get);
|
||||
if (desc.set)
|
||||
obj.__defineSetter__(name, desc.set);
|
||||
} else {
|
||||
obj[name] = desc.value;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
function describe(obj, name) {
|
||||
try {
|
||||
return _describe(obj, name);
|
||||
} catch (e) {}
|
||||
// Emulate Object.getOwnPropertyDescriptor for outdated browsers
|
||||
// NOTE: We're also falling back on this scenario currently when the
|
||||
// above trigggers an exception.
|
||||
var get = obj.__lookupGetter__ && obj.__lookupGetter__(name);
|
||||
return get
|
||||
? { get: get, set: obj.__lookupSetter__(name),
|
||||
enumerable: true, configurable: true }
|
||||
: obj.hasOwnProperty(name)
|
||||
? { value: obj[name], writable: true ,
|
||||
enumerable: true, configurable: true }
|
||||
: null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue