Reuse a constant Discard() instance
This commit is contained in:
parent
1f852a72e7
commit
f56cbd9ed3
|
@ -33,6 +33,8 @@ Seal.prototype.toJSON = function () {
|
|||
};
|
||||
|
||||
module.exports.Discard = Record.makeConstructor('discard', []);
|
||||
module.exports.Discard._instance = module.exports.Discard();
|
||||
|
||||
module.exports.Capture = Record.makeConstructor('capture', ['specification']);
|
||||
module.exports.Observe = Record.makeConstructor('observe', ['specification']);
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ function hasCapturesOrDiscards(nodePath) {
|
|||
return result;
|
||||
}
|
||||
|
||||
const _discardAst = template.expression(`SYNDICATE.Discard()`);
|
||||
const _discardAst = template.expression(`SYNDICATE.Discard._instance`);
|
||||
function discardAst(state) {
|
||||
return _discardAst({ SYNDICATE: state.SyndicateID });
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue