@webqit/oohtml 4.1.5 → 4.1.6

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.1.5",
17
+ "version": "4.1.6",
18
18
  "license": "MIT",
19
19
  "repository": {
20
20
  "type": "git",
@@ -52,10 +52,18 @@ function createDynamicScope( config, root ) {
52
52
  if ( _( root ).has( 'data-binding' ) ) return _( root ).get( 'data-binding' );
53
53
  const scope = Object.create( null ), abortController = new AbortController;
54
54
  scope[ '$exec__' ] = ( target, prop, ...args ) => {
55
- realdom.schedule( 'write', () => target[ prop ]( ...args ) );
55
+ const exec = () => {
56
+ try { target[ prop ]( ...args ); }
57
+ catch( e ) { console.error( `${ e.message } at ${ e.cause }` ); }
58
+ };
59
+ realdom.schedule( 'write', exec );
56
60
  };
57
61
  scope[ '$assign__' ] = ( target, prop, val ) => {
58
- realdom.schedule( 'write', () => (target[ prop ] = val) );
62
+ const exec = () => {
63
+ try { target[ prop ] = val; }
64
+ catch( e ) { console.error( `${ e.message } at ${ e.cause }` ); }
65
+ };
66
+ realdom.schedule( 'write', exec );
59
67
  };
60
68
  Observer.intercept( scope, {
61
69
  get: ( e, recieved, next ) => {
@@ -126,7 +134,11 @@ async function mountDiscreteBindings( config, ...entries ) {
126
134
  const compiled = compileDiscreteBindings( config, template.expr );
127
135
  const { scope, bindings } = createDynamicScope.call( this, config, textNode.parentNode );
128
136
  Object.defineProperty( textNode, '$oohtml_internal_databinding_anchorNode', { value: anchorNode, configurable: true } );
129
- bindings.set( textNode, { state: await ( await compiled.bind( textNode, scope ) ).execute(), } );
137
+ try {
138
+ bindings.set( textNode, { state: await ( await compiled.bind( textNode, scope ) ).execute(), } );
139
+ } catch( e ) {
140
+ console.log(e);
141
+ }
130
142
  }
131
143
  }
132
144
 
@@ -148,7 +160,11 @@ async function mountInlineBindings( config, ...entries ) {
148
160
  const { scope, bindings } = createDynamicScope.call( this, config, node );
149
161
  const signals = [];
150
162
  Object.defineProperty( node, '$oohtml_internal_databinding_signals', { value: signals, configurable: true } );
151
- bindings.set( node, { signals, state: await ( await compiled.bind( node, scope ) ).execute(), } );
163
+ try {
164
+ bindings.set( node, { signals, state: await ( await compiled.bind( node, scope ) ).execute(), } );
165
+ } catch( e ) {
166
+ console.log(e);
167
+ }
152
168
  }
153
169
  }
154
170