@webqit/oohtml 4.3.0 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "wicg-proposal"
15
15
  ],
16
16
  "homepage": "https://webqit.io/tooling/oohtml",
17
- "version": "4.3.0",
17
+ "version": "4.3.1",
18
18
  "license": "MIT",
19
19
  "repository": {
20
20
  "type": "git",
@@ -172,6 +172,7 @@ const inlineParseCache = new Map;
172
172
  function compileInlineBindings( config, str ) {
173
173
  if ( inlineParseCache.has( str ) ) return inlineParseCache.get( str );
174
174
  const validation = {};
175
+ let $event_i = -1;
175
176
  const source = _splitOuter( str, ';' ).map( str => {
176
177
  const [ left, right ] = _splitOuter( str, ':' ).map( x => x.trim() );
177
178
  const directive = left[ 0 ], param = left.slice( 1 ).trim();
@@ -241,11 +242,12 @@ function compileInlineBindings( config, str ) {
241
242
  }
242
243
  // Events
243
244
  if ( directive === '@' ) {
245
+ $event_i++;
244
246
  return `
245
- const handler = event => ${ right.startsWith('{') ? right : arg };
246
- this.addEventListener( '${ param }', handler );
247
- const abort = () => this.removeEventListener( '${ param }', handler );
248
- this.$oohtml_internal_databinding_signals?.push( { abort } );
247
+ const handler${ $event_i } = event => ${ right.startsWith('{') ? right : arg };
248
+ this.addEventListener( '${ param }', handler${ $event_i } );
249
+ const abort${ $event_i } = () => this.removeEventListener( '${ param }', handler${ $event_i } );
250
+ this.$oohtml_internal_databinding_signals?.push( { abort: abort${ $event_i } } );
249
251
  `;
250
252
  }
251
253
  // Functions