@webqit/oohtml 2.1.19 → 2.1.20

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": "2.1.19",
17
+ "version": "2.1.20",
18
18
  "license": "MIT",
19
19
  "repository": {
20
20
  "type": "git",
@@ -19,7 +19,7 @@ export default function init( { advanced = {}, ...$config } ) {
19
19
  advanced: resolveParams( advanced, {
20
20
  parserParams: { allowReturnOutsideFunction: false, allowSuperOutsideMethod: false },
21
21
  compilerParams: { globalsNoObserve: [ 'alert' ] },
22
- runtimeParams: { apiVersion: 2 },
22
+ runtimeParams: { apiVersion: 2, compileFunction: this.webqit.compileFunctionCallback },
23
23
  } ),
24
24
  } );
25
25
  config.scriptSelector = ( Array.isArray( config.script.mimeType ) ? config.script.mimeType : [ config.script.mimeType ] ).reduce( ( selector, mm ) => {
@@ -27,7 +27,7 @@ export default function init( { advanced = {}, ...$config } ) {
27
27
  return selector.concat( `script${ qualifier }[scoped],script${ qualifier }[contract]` );
28
28
  }, [] ).join( ',' );
29
29
  window.webqit.oohtml.Script = { compileCache: [ new Map, new Map, ] };
30
- window.webqit.SubscriptFunction = config.SubscriptFunction/* allow for injection, e.g. from test runner */ || SubscriptFunction;
30
+ window.webqit.SubscriptFunction/* if already injected */ || ( window.webqit.SubscriptFunction = SubscriptFunction );
31
31
  window.webqit.Observer = Observer;
32
32
  realtime.call( window, config );
33
33
  }
package/test/index.js CHANGED
@@ -55,16 +55,13 @@ export function createDocumentForScopedJS( head = '', body = '', callback = null
55
55
  window.testRecords = [];
56
56
  createContext( window );
57
57
  // Running advanced scripts
58
- init.call( window, { SCOPED_JS: {
58
+ window.webqit = {
59
59
  SubscriptFunction,
60
- advanced: {
61
- runtimeParams: {
62
- compileFunction: ( code, parameters ) => compileFunction( code, parameters, {
63
- parsingContext: window,
64
- } ),
65
- }
66
- }
67
- } } );
60
+ compileFunctionCallback: ( code, parameters ) => compileFunction( code, parameters, {
61
+ parsingContext: window,
62
+ } ),
63
+ };
64
+ init.call( window );
68
65
  // Running basic scripts
69
66
  const dom = webqitDom.call( window );
70
67
  if ( params.runScripts !== 'dangerously' ) {