batiste / pug-vdom

PUG template to HyperScript Virtual DOM
MIT License
18 stars 6 forks source link

Fix issue #42: locals cleared when executing a template inside another template #45

Closed albb0920 closed 4 years ago

albb0920 commented 4 years ago

Hi

This is my attempt on #42 . Runtime function exposeLocals() and deleteExposedLocals() is now wrapped in enterLocalsScope() and exitLocalsScope().

enterLocalsScope() will push exposed new locals to exposedLocalsStack, and remove them when exitLocalsScope() is called.

This change is backward compatible with generated modules from previous version by adding these alias.

exports.exposeLocals = enterLocalsScope;
exports.deleteExposedLocals = exitLocalsScope;

Thanks!

albb0920 commented 4 years ago

@gryphonmyers @batiste any chance to give this a look?

gryphonmyers commented 4 years ago

Sure

On Tue, Aug 25, 2020, 11:46 PM Albert Song notifications@github.com wrote:

@gryphonmyers https://github.com/gryphonmyers @batiste https://github.com/batiste any chance to give this a look?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/batiste/pug-vdom/pull/45#issuecomment-680692462, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMENWFLAGSCT7D55QFGP3TSCSVS7ANCNFSM4JAYDWDQ .

yssrku commented 1 year ago

This PR is not yet merged to master?