@@ -1083,16 +1083,14 @@ var setAttr = (vnode, element, mask, key, old, attrs) => {
10831083// 4. The event name is remapped to the handler before calling it.
10841084// 5. In function-based event handlers, `ev.currentTarget === this`. We replicate that below.
10851085// 6. In function-based event handlers, `return false` prevents the default action and stops event
1086- // propagation. Instead of that, we hijack it to control implicit redrawing, and let users
1087- // return a promise that resolves to it.
1086+ // propagation. Instead of that, we hijack the return value, so we can have it auto-redraw if
1087+ // the user returns `"skip-redraw"` or a promise that resolves to it.
10881088class EventDict extends Map {
10891089 async handleEvent ( ev ) {
10901090 invokeRedrawable ( this . _ , this . get ( `on${ ev . type } ` ) , ev . currentTarget , ev )
10911091 }
10921092}
10931093
1094- //event
1095-
10961094var currentlyRendering = [ ]
10971095
10981096m . render = ( dom , vnode , { redraw, removeOnThrow} = { } ) => {
@@ -1175,9 +1173,8 @@ m.mount = (root, view) => {
11751173 }
11761174 }
11771175 var redraw = ( ) => { if ( ! id ) id = window . requestAnimationFrame ( redraw . sync ) }
1178- var Mount = function ( _ , old ) {
1179- return [ m . remove ( unschedule ) , view . call ( this , ! old ) ]
1180- }
1176+ // Cheating with context access for a minor bundle size win.
1177+ var Mount = ( _ , old ) => [ m . remove ( unschedule ) , view . call ( currentContext , ! old ) ]
11811178 redraw . sync = ( ) => {
11821179 unschedule ( )
11831180 m . render ( root , m ( Mount ) , { redraw} )
0 commit comments