Ensure 'super' in methods and getters
Open
@medikoo is already working on this.
Since Jul 21, 2016.
- Dominant language
- JavaScript
- Stars
- 27
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
Not sure if we can rely on native super, it's likely it can't be the case, then I imagine it as:
this.super('methodName')();
Where internal implementation could be similar to:
Base.prototype.super = function (propName) {
var currentObject = this, superObject, superValue;
while (!currentObject.hasOwnProperty(propName)) {
currentObject = Object.getPrototypeOf(currentObject);
if (!currentObject) return;
}
superObject = Object.getPrototypeOf(currentObject);
if (!superObject) return;
superValue = superObject[propName]; // TODO: Take into account getter case
if (typeof superValue === 'function') superValue = Function.prototype.bind.call(superValue, this);
return superValue;
};
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.