【发布时间】:2014-05-23 13:23:59
【问题描述】:
我正在使用 google 闭包构建 API。
我想从子类 B 中具有同名的方法中访问超类 A 的方法。
请看下面的伪代码:
超类 A
class A {
move: function() { ... }
}
儿童B班
class B extends A {
// B has its own 'move' method which uses the 'move' method from A
move: function() {
parentClass_.move();
}
}
我在某处读到关键字“parentClass”就是这样做的。 我读到here 是关键字“superClass_”这样做的。
它们都不起作用。也许我做错了。
有人可以帮帮我吗?
谢谢。
若昂
【问题讨论】:
标签: javascript class methods google-closure-compiler