Skip to content

Conversation

@sethkinast
Copy link
Contributor

( instead of pushing our own copies onto the stack )

I think anything that manually manipulates the stack directly is a smell. We already have these properties available as context.stack.index and context.stack.of. It doesn't seem to make sense to directly reach into the stack's head and manually set them there.

Instead, we can short-circuit get in these cases.

This also has the side effect of not polluting someone's context.current() with something they didn't expect to be there.

I would just like to get some discussion on this one, I'm not convinced it's correct yet.

@sethkinast
Copy link
Contributor Author

Manually setting $idx and $len to undefined after is especially distasteful to me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this for?

@sethkinast
Copy link
Contributor Author

I would like to get something like this in for Dust@3 in which I don't plan on supporting IE8. Shall we make this a getter?

Copy link

@shivaylamba shivaylamba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants