Event.target always return null
At https://github.com/saghul/txiki.js/blob/6e01bf4a0cbc1aba6dcdddf1d0aa67df287ce420/src/js/polyfills/event-target.js#L95-L103
txiki.js seem to always return null for Event.target
According to https://developer.mozilla.org/en-US/docs/Web/API/Event/target It should be the eventTarget on where dispatchEvent called.
Maybe we can simply fix it by below code?
get target() {
return this.currentTarget;
}
What is your use case?
What is your use case?
My code is simplicified like below
new Worker('xxx.js').addEventListener('message',function(ev){
ev.target.postMessage('xxx')
})
This code work correctly on firefox and chrome, but throw on txiki.js
Got it. A PR would be welcome, if you're up for it!
Got it. A PR would be welcome, if you're up for it!
Ok. I create a patch, after learning how to bundle modified js.
I'm not familiar with such js bundling.Maybe we should remove the generated bytecode from repository? Which may cause the code repository size to expand rapidly.