Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug with select_block_type function #1195

Closed
webdesus opened this issue Feb 26, 2018 · 5 comments
Closed

bug with select_block_type function #1195

webdesus opened this issue Feb 26, 2018 · 5 comments
Labels

Comments

@webdesus
Copy link

We have code wich work perfect in 1.54.1 version. But in 1.56 this code not working.

Exampes:

function select_block_type in new version not get header argument

function select_block_type(state) {
	if (!header.icon) return create_if_block_2;
	return create_if_block_3;
}
@aphitiel
Copy link
Contributor

Was just preparing a REPL about the same problem:

Throws "item is not defined" - seems to happen when using {{else}} inside {{#each}}. If the {{else}} is removed, no error is thrown.

Works fine with 0.55.

@Conduitry
Copy link
Member

It looks like the issue is right here (and also right here). The code is attempting to use values from state without actually retrieving them from the state object. I'm taking a peek at this, but all of this code was heavily refactored for 1.56.0 and so I'm not very familiar with it yet.

@Conduitry Conduitry added the bug label Feb 28, 2018
@alecglassford
Copy link

alecglassford commented Feb 28, 2018

It looks like you identified the issue, but in case it's helpful I was running into the same problem with {{else}} inside {{#await}}: 1.55.1 vs 1.56.0. I'm assuming this goes back to the same thing.

@bwbroersma
Copy link
Contributor

Here is the most minimal test case with just a single {{#each}} and {{#if}}-{{else}} I could build: 1.55.1 vs 1.56.0.

Conduitry added a commit that referenced this issue Mar 2, 2018
Rich-Harris added a commit that referenced this issue Mar 5, 2018
Fix select_block_type scoping issue
@Rich-Harris
Copy link
Member

Fixed in 1.56.1 — thanks all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants