@webqit/oohtml 4.1.2 → 4.1.3

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.2",
17
+ "version": "4.1.3",
18
18
  "license": "MIT",
19
19
  "repository": {
20
20
  "type": "git",
@@ -71,11 +71,11 @@ async function execute( config, execHash ) {
71
71
  script.textContent = await compiledScript.toString();
72
72
  }
73
73
  // Execute and save state
74
- const documentRoot = script.getRootNode();
75
- if ( !_( documentRoot ).has( 'scriptEnv' ) ) {
76
- _( documentRoot ).set( 'scriptEnv', Object.create( null ) );
74
+ const varScope = script.scoped ? thisContext : script.getRootNode();
75
+ if ( !_( varScope ).has( 'scriptEnv' ) ) {
76
+ _( varScope ).set( 'scriptEnv', Object.create( null ) );
77
77
  }
78
- const state = ( await compiledScript.bind( thisContext, _( documentRoot ).get( 'scriptEnv' ) ) ).execute();
78
+ const state = ( await compiledScript.bind( thisContext, _( varScope ).get( 'scriptEnv' ) ) ).execute();
79
79
  if ( script.quantum ) { Object.defineProperty( script, 'state', { value: state } ); }
80
80
  realdom.realtime( window.document ).observe( script, () => {
81
81
  if ( script.quantum ) { state.dispose(); }