generators inside DOM events

Domenic Denicola domenic at domenicdenicola.com
Wed Jan 8 12:53:44 PST 2014


What? That would just cause the event handler function to return a generator object, which the browser would not use or do anything with. It would have no effect.


________________________________
From: es-discuss <es-discuss-bounces at mozilla.org> on behalf of Andrea Giammarchi <andrea.giammarchi at gmail.com>
Sent: Wednesday, January 08, 2014 15:50
To: es-discuss at mozilla.org
Subject: generators inside DOM events

I am not sure this has been discussed already but I wonder what would happen if `yield` is used inside an event such 'beforeunload', 'unload', or even 'click' and others DOM related events.

Main concerns:

  1.  it's a UA trap potentially making impossible to leave a page or complete a user meant action
  2.  not even transpilers can solve cases like this (i.e. a still valid event eventually stopped after some generator logic where if simulated the event would be expired at the time the function will be invoked)

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140108/d02b60f2/attachment.html>


More information about the es-discuss mailing list