Update to latest straps.js

Enabling paper.install(window) again.
This commit is contained in:
Jürg Lehni 2013-05-27 15:25:40 -07:00
parent 6bb681b56d
commit 268003f241

View file

@ -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;
}
/**