bobe 0.0.50 → 0.0.52
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/dist/bobe.cjs.js +7 -1
- package/dist/bobe.cjs.js.map +1 -1
- package/dist/bobe.compiler.cjs.js +7 -1
- package/dist/bobe.compiler.cjs.js.map +1 -1
- package/dist/bobe.compiler.esm.js +7 -1
- package/dist/bobe.compiler.esm.js.map +1 -1
- package/dist/bobe.esm.js +7 -1
- package/dist/bobe.esm.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.umd.js +7 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -416,6 +416,7 @@ interface BaseNode {
|
|
|
416
416
|
type: ASTNodeType;
|
|
417
417
|
loc?: SourceLocation;
|
|
418
418
|
hasError?: boolean;
|
|
419
|
+
parent?: BaseNode;
|
|
419
420
|
}
|
|
420
421
|
interface Program extends BaseNode {
|
|
421
422
|
type: NodeType.Program;
|
|
@@ -487,6 +488,7 @@ declare class Compiler {
|
|
|
487
488
|
tokenizer: Tokenizer;
|
|
488
489
|
hooks: ParseHooks;
|
|
489
490
|
errors: ParseError[];
|
|
491
|
+
currentParent?: BaseNode;
|
|
490
492
|
constructor(tokenizer: Tokenizer, hooks?: ParseHooks);
|
|
491
493
|
private addError;
|
|
492
494
|
/**
|
package/dist/index.umd.js
CHANGED
|
@@ -1320,12 +1320,16 @@
|
|
|
1320
1320
|
}
|
|
1321
1321
|
function NodeHook(target, context) {
|
|
1322
1322
|
return function (_node) {
|
|
1323
|
+
const prevParent = this.currentParent;
|
|
1323
1324
|
const hook = this.hooks[context.name];
|
|
1324
1325
|
const node = {
|
|
1325
1326
|
loc: {}
|
|
1326
1327
|
};
|
|
1328
|
+
node.parent = prevParent;
|
|
1327
1329
|
hook?.enter?.call(this, node);
|
|
1330
|
+
this.currentParent = node;
|
|
1328
1331
|
const result = target.call(this, node);
|
|
1332
|
+
this.currentParent = prevParent;
|
|
1329
1333
|
hook?.leave?.call(this, node);
|
|
1330
1334
|
return result;
|
|
1331
1335
|
};
|
|
@@ -2025,7 +2029,9 @@
|
|
|
2025
2029
|
const render = ComponentOrRender;
|
|
2026
2030
|
const boundStore = render.boundStore;
|
|
2027
2031
|
child = aoye.deepSignal({}, aoye.getPulling(), true);
|
|
2028
|
-
|
|
2032
|
+
if (boundStore) {
|
|
2033
|
+
Object.setPrototypeOf(child, boundStore);
|
|
2034
|
+
}
|
|
2029
2035
|
tokenizer = render(true);
|
|
2030
2036
|
}
|
|
2031
2037
|
const node = {
|