@xaendar/compiler 0.7.11 → 0.7.12

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.
@@ -592,8 +592,8 @@ function mapEvents(events, compilerContext) {
592
592
  }
593
593
  function getPrecode(tagName) {
594
594
  switch (tagName) {
595
- case "svg": return "context.createElement = (tagName) => document.createElementNS(SVG_NS, tagName);";
596
- case "math": return "context.createElement = (tagName) => document.createElementNS(MATHML_NS, tagName);";
595
+ case "svg": return "context.createElement = (tagName) => document.createElementNS(SVG_NS, tagName).bind(document);";
596
+ case "math": return "context.createElement = (tagName) => document.createElementNS(MATHML_NS, tagName).bind(document);";
597
597
  default: return "";
598
598
  }
599
599
  }
@@ -851,7 +851,7 @@ var Generator = class {
851
851
  generate() {
852
852
  this._nodeToProcess.clear();
853
853
  const compilerContext = new CompilerContext();
854
- const renderFunctions = ["_render() {", ...indent([`const ${ROOT_NODE} = this._root;`, "const context = new Context(this, { createElement: document.createElement, get: () => undefined });"])];
854
+ const renderFunctions = ["_render() {", ...indent([`const ${ROOT_NODE} = this._root;`, "const context = new Context(this, { createElement: document.createElement.bind(document), get: () => undefined });"])];
855
855
  if (this._cssVariableName) renderFunctions.push(indent(`${ROOT_NODE}.adoptedStyleSheets = [${this._cssVariableName}];`));
856
856
  for (let i = 0; i < this._ast.length; i++) {
857
857
  const { code, functionsToProcess } = this._processNode(this._ast[i], ROOT_NODE, i.toString(), compilerContext, null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xaendar/compiler",
3
- "version": "0.7.11",
3
+ "version": "0.7.12",
4
4
  "description": "A library for transpiling Xaendar Templates into JavaScript code",
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -16,8 +16,8 @@
16
16
  }
17
17
  },
18
18
  "dependencies": {
19
- "@xaendar/common": "0.7.11",
20
- "@xaendar/types": "0.7.11",
19
+ "@xaendar/common": "0.7.12",
20
+ "@xaendar/types": "0.7.12",
21
21
  "typescript": "^6.0.3"
22
22
  }
23
23
  }