Last modified: 2014-11-05 20:06:27 UTC
{}.watch exists in Firefox when using OO.EventEmitter.on with the event name 'watch' in Firefox it triggers an error `get a JS error (TypeError: this.bindings[event].slice is not a function) ` When the object hasOwnProperty is should throw an exception or alternatively 'watch' should be a possible event name. Unfortunately we've hit this bug before `watch` is such a nice event name ;-) See also: Bug 72984
watch sounds incredibly generic and as such a bad event name :)
How exactly are you triggering this error? widget.on('watch', function () {} ); widget.emit('watch'); works for me.
I see if you emit without binding anything you get a problem (although that begs the question why you'd want to do that). If we just wrap that code in a hasOwnProperty check there won't be a problem. We don't need to blacklist watch or throw exceptions.
Change 171293 had a related patch set uploaded by Esanders: Use hasOwn check in EventEmitter#emit https://gerrit.wikimedia.org/r/171293
Change 171293 merged by jenkins-bot: EventEmitter: Use hasOwn check in #emit https://gerrit.wikimedia.org/r/171293
Perfect! :) Thanks for quick response!
Will go into OOjs v1.1.2, which we'll release today and get into MW for 1.25wmf8. Is this sufficient, or would you need it back-ported?
Doesn't seem to have made it out to mediawiki.org...
(In reply to Jon from comment #8) > Doesn't seem to have made it out to mediawiki.org... OOjs 1.1.2 isn't built yet, and MW 1.25wmf8 won't reach MediaWiki.org for a week…