Proper "this" scoping in react{}
This commit is contained in:
parent
71fed1eb48
commit
3dc6559d26
|
@ -162,5 +162,5 @@ export function DuringStatement(node) {
|
||||||
export function SyndicateReactStatement(node) {
|
export function SyndicateReactStatement(node) {
|
||||||
this.word("react");
|
this.word("react");
|
||||||
this.space();
|
this.space();
|
||||||
this.print(node.body, node);
|
this.printBlock(node.bodyProc);
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,7 +122,7 @@ export default class SyndicateParser extends _original_Parser {
|
||||||
if (this.isContextual("react")) {
|
if (this.isContextual("react")) {
|
||||||
this.next();
|
this.next();
|
||||||
const node = this.startNode();
|
const node = this.startNode();
|
||||||
node.body = this.parseStatement();
|
node.bodyProc = this.parseSyntheticFunctionStatement();
|
||||||
return this.finishNode(node, "SyndicateReactStatement");
|
return this.finishNode(node, "SyndicateReactStatement");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -540,10 +540,10 @@ export default declare((api, options) => {
|
||||||
path.replaceWith(template(
|
path.replaceWith(template(
|
||||||
`DATASPACE._currentFacet.actor.addFacet(
|
`DATASPACE._currentFacet.actor.addFacet(
|
||||||
DATASPACE._currentFacet,
|
DATASPACE._currentFacet,
|
||||||
function () { BODY },
|
BODYPROC,
|
||||||
true);`)({
|
true);`)({
|
||||||
DATASPACE: state.DataspaceID,
|
DATASPACE: state.DataspaceID,
|
||||||
BODY: node.body,
|
BODYPROC: node.bodyProc,
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -196,12 +196,12 @@ defineType("DuringStatement", {
|
||||||
});
|
});
|
||||||
|
|
||||||
defineType("SyndicateReactStatement", {
|
defineType("SyndicateReactStatement", {
|
||||||
builder: ["body"],
|
builder: ["bodyProc"],
|
||||||
visitor: ["body"],
|
visitor: ["bodyProc"],
|
||||||
aliases: ["Statement"],
|
aliases: ["Statement"],
|
||||||
fields: {
|
fields: {
|
||||||
body: {
|
bodyProc: {
|
||||||
validate: assertNodeType("Statement"),
|
validate: assertNodeType("FunctionExpression"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue