Skip to content

Conversation

cherifGsoul
Copy link
Member

@cherifGsoul cherifGsoul commented Apr 12, 2019

This adds warning when a closing magic tag is missed for example the following triggers a warning:
{{# let foo="bar"}} {{foo}}

The changes:

The warning is added to done function

Fixes #675

Copy link
Contributor

@bmomberger-bitovi bmomberger-bitovi left a comment

Choose a reason for hiding this comment

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

Please try removing the if predicate referenced in the inline comments, and if it passes testing, commit the change.

can-stache.js Outdated
// warn if closing magic tag is missed #675
var last = state.sectionElementStack[state.sectionElementStack.length - 1];
if (process.env.NODE_ENV !== 'production') {
if(section instanceof HTMLSectionBuilder) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you need this line here. The block you copied this from (probabaly makeRendererAndUpdateSection) was in a function that was passed section as a parameter. In this function you're just referencing the top level section, which is always an HTMLSectionBuilder.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I added this check in the 2nd commit the first one was good.

Copy link
Member Author

Choose a reason for hiding this comment

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

is fixed now

cherifGsoul and others added 15 commits April 12, 2019 23:31
Update testee to the latest version 🚀
* Handle nested call functions

Allows use of returning functions from functions

* Include stache test for nested call expression
This fixes the memory leak in the portal helper. The problem was that we
were never unregistering the call to `domMutate.onNodeRemoval` so there
was always a pointer to the MutationObserver that is observing the
document.

This adds a page in `benchmark/portal-mem.html` that can be used to find
memory leaks.

Fixes #684
Fix memory leak in portal helper
Use can-dom-data instead of can-dom-data-state
add documentation for data helper
can-stache.js Outdated
done: function(lineNo){
//!steal-remove-start
// warn if closing magic tag is missed #675
var last = state.sectionElementStack[state.sectionElementStack.length - 1];
Copy link
Contributor

Choose a reason for hiding this comment

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

move this inside

@cherifGsoul
Copy link
Member Author

I close this for #692

@cherifGsoul cherifGsoul deleted the fix-let-closing-tag branch May 22, 2019 21:13
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.

Misleading error message if {{#let ...}} is used without closing tag
6 participants