Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parent to richbase with test case #439

Closed
wants to merge 5 commits into from
Closed

Conversation

goto100
Copy link
Contributor

@goto100 goto100 commented Aug 7, 2013

parent支持需要类方法能够获取到自己的名字,这个名字是存储在类方法自己身上的。

如果出现将某一函数设置给不同名字的类成员,则会throw Error,以避免调用parent错误,但这样有可能影响现有的代码,建议改成warning输出,不知是否可以直接使用console.warning输出此信息?

@goto100
Copy link
Contributor Author

goto100 commented Aug 8, 2013

同继承链上的方法应该拥有类似的行为,父类方法同步,子类变成异步这种编码应该被禁止。但也无法排除方法内有闭包的情况,我的设计是:

普通情况:

this.parent(1,2,3);
// 或者
S.parent(this, 1, 2, 3);

闭包情况:

var parent = S.parent.bind(arguments.callee, this);
(function() {
    parent(1, 2, 3);
})();

@goto100
Copy link
Contributor Author

goto100 commented Aug 8, 2013

支持闭包中的parent,重新提交。

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 1c20817 on goto100:master into * on kissyteam:master*.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants