mirror of https://github.com/svaarala/duktape.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
648 B
22 lines
648 B
8 years ago
|
/*
|
||
|
* Object.prototype.__lookupGetter__ polyfill
|
||
|
*/
|
||
|
|
||
|
(function () {
|
||
|
if (typeof Object.prototype.__lookupGetter__ === 'undefined') {
|
||
|
var DP = Object.defineProperty;
|
||
|
var GPO = Object.getPrototypeOf;
|
||
|
var GOPD = Object.getOwnPropertyDescriptor;
|
||
|
DP(Object.prototype, '__lookupGetter__', {
|
||
|
value: function (n) {
|
||
|
for (var o = this; o; o = GPO(o)) {
|
||
|
var p = GOPD(o, n);
|
||
|
if (p) {
|
||
|
return p.get;
|
||
|
}
|
||
|
}
|
||
|
}, writable: true, enumerable: false, configurable: true
|
||
|
});
|
||
|
}
|
||
|
})();
|