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

クラスモジュール(h5.cls)の作成 #562

Closed
simdy opened this issue Jun 1, 2016 · 2 comments
Closed

クラスモジュール(h5.cls)の作成 #562

simdy opened this issue Jun 1, 2016 · 2 comments
Assignees
Milestone

Comments

@simdy
Copy link
Member

simdy commented Jun 1, 2016

h5.cls空間にて、「クラス」の仕組みを作成する。

なお、これはJavaやC#等と完全に同等なレベルのクラスベースオブジェクト指向を実現するものではなく、
ES5、ないしES2015のclass構文に近い程度で実現できる範疇の型継承等を実現する
あくまで簡易な機構とする。

@simdy
Copy link
Member Author

simdy commented Jun 1, 2016

昨今のユーザーの利用ブラウザの傾向やベンダーによるサポート期限等を鑑み、
本モジュールはIE11およびモダンブラウザでの利用を前提とする。
(IE8以下は、サポート外もしくは一部仕様制限を受けることが予想される。IE9については要検討。)

simdy pushed a commit that referenced this issue Jun 1, 2016
指定を追加。trueにすると、そのクラスのインスタンスは作成できなくなる。デフォルトfalse。
simdy pushed a commit that referenced this issue Jun 2, 2016
MyClass._super.call(this)の呼び出しが失敗しづらいようにするため)
simdy pushed a commit that referenced this issue Jun 3, 2016
simdy pushed a commit that referenced this issue Jun 3, 2016
クラスディスクリプタのメソッド定義で関数以外を記述されたらエラーにするようにした。
ClassDescriptorにisDynamic指定を書けるようにし、明示的にtrueが指定されない限り、
インスタンス作成時にObject.seal()を行って動的なプロパティの追加・削除ができないようにした。
simdy pushed a commit that referenced this issue Jun 7, 2016
これに伴い、プロパティ名も「field, accessor, method」に変更。
(元々はアクセサは property: { prop: { isAccessor:true} } のように定義していたが、
 アクセサの場合アクセサ関数を書きたいこと、かといってそれはメソッドとは違うこと
 (参考:ES2015等ではget function prop() のようにget, setキーワードで書く))、
 フィールドの部分にアクセサの関数まで書くと長くなって見通しが良くないこと、
 アクセサとフィールドは機能的・定義可能な値としても別であることから
 分割して定義することとした。
tkmHashi pushed a commit that referenced this issue Sep 26, 2016
h5-file-construction.xmlにclsモジュール定義の記述追加
build_for_js.xmlにclsモジュールを読み込む記述追加
@simdy simdy added this to the v1.3.1 milestone Apr 9, 2018
@simdy
Copy link
Member Author

simdy commented Apr 9, 2018

hifive ver.1.3系にてリリース済み。

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

No branches or pull requests

1 participant