50 lines
1.2 KiB
JavaScript
50 lines
1.2 KiB
JavaScript
"use strict";
|
|
|
|
var _get = function get(object, property, receiver) {
|
|
var desc = Object.getOwnPropertyDescriptor(object, property);
|
|
|
|
if (desc === undefined) {
|
|
var parent = Object.getPrototypeOf(object);
|
|
|
|
if (parent === null) {
|
|
return undefined;
|
|
} else {
|
|
return get(parent, property, receiver);
|
|
}
|
|
} else if ("value" in desc && desc.writable) {
|
|
return desc.value;
|
|
} else {
|
|
var getter = desc.get;
|
|
if (getter === undefined) {
|
|
return undefined;
|
|
}
|
|
return getter.call(receiver);
|
|
}
|
|
};
|
|
|
|
var _inherits = function (subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
constructor: {
|
|
value: subClass,
|
|
enumerable: false,
|
|
writable: true,
|
|
configurable: true
|
|
}
|
|
});
|
|
if (superClass) subClass.__proto__ = superClass;
|
|
};
|
|
|
|
var Test = (function (Foo) {
|
|
function Test() {
|
|
_get(Object.getPrototypeOf(Test.prototype), "test", this);
|
|
_get(Object.getPrototypeOf(Test.prototype), "test", this).whatever;
|
|
}
|
|
|
|
_inherits(Test, Foo);
|
|
|
|
return Test;
|
|
})(Foo);
|