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

EventDispatcher.addEventListener()で、第3引数以降指定されていた場合はエラーではなく無視するようにする #341

Closed
fukudayasuo opened this issue Jun 9, 2014 · 0 comments
Assignees
Labels
Milestone

Comments

@fukudayasuo
Copy link

EventDispatcher.addEventListener()で、引数の長さが2つでなければエラーが投げられる。

var obj = {};
h5.mixin.eventDispatcher.mix(obj);
obj.addEventListener('myevent', function(){}, false);
// code: 16000; addEventListenerには、イベント名(文字列)、イベントリスナ(関数)を渡す必要があります。

jQueryのbindなどでイベントをバインドするときに第3引数が渡されるので、jQueryを使ってbindすることができない。

$(obj).bind('myevent', function(){}); // エラー

jQueryを使ってbindもできるように、addEventListenerの引数チェックは、第3引数以降があっても無視するようにする。

fukudayasuo pushed a commit to hifive-labs/hifivemain that referenced this issue Jun 9, 2014
…ました。

第3引数を指定した時にエラーにならないことをチェックするテストケースを追加しました。
jQuery.bind()でイベントハンドラをバインドするテストケースを追加しました。
jQuery.trigger()でイベントハンドラを呼び出すテストケースを追加しました。
@simdy simdy added the bug label Jun 9, 2014
@simdy simdy added this to the v1.1.11 milestone Jun 9, 2014
@simdy simdy closed this as completed Jun 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants