js,prototype =其他原型合法吗?

时间:2017-10-08 02:30:04

标签: javascript inheritance prototype

嗨引用方法是合法的,原型就像这样。

animationControler_Actors.prototype.addMotionContext_linear = animationControler_Pictures.prototype.addMotionContext_linear; // compatibility with Actor Module
animationControler_Events.prototype.addMotionContext_linear = animationControler_Pictures.prototype.addMotionContext_linear; // compatibility with Events Module

我想避免重复相同的代码,所以我这样指定。

感谢 (求助关闭)

0 个答案:

没有答案