Created
July 9, 2017 12:53
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AnimalClass = h5.cls.RootClass.extend(function (super_) { | |
return { | |
// クラス名(完全修飾名) | |
name: 'AnimalClass', | |
isAbstract: true, | |
// クラスのフィールド定義 | |
field: { | |
_name: null | |
}, | |
// クラスのメソッド定義 | |
method: { | |
constructor: function (params) { | |
// 親クラスのコンストラクタ呼び出し | |
super_.constructor.call(this); | |
this._name = params; | |
}, | |
hello: function() { | |
return this._name; | |
}, | |
cry: function(name, voice) { | |
return name + "'s crying voice is " + voice; | |
} | |
} | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment