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

Runtime panic in template related to defer (needs investigation) #936

Open
zapateo opened this issue Jun 8, 2022 · 1 comment
Open

Runtime panic in template related to defer (needs investigation) #936

zapateo opened this issue Jun 8, 2022 · 1 comment
Labels
bug Bug: something already implemented does not work as it should needsInvestigation Need to investigate RuntimeError A bug in Scriggo caused an error/panic at runtime templates Related to the template

Comments

@zapateo
Copy link
Member

zapateo commented Jun 8, 2022

How to reproduce

Add this test to test/misc/templates_test.go:

"https://github.com/open2b/scriggo/issues/936": {
	sources: fstest.Files{
		"index.txt": `
			{% var f = func() []int {
				defer func() { }()
				return []int{}
			} %}
	
			{% for v in f() %}
			{% end for %}
	
			Some text`,
	},
},
@zapateo zapateo added bug Bug: something already implemented does not work as it should needsInvestigation Need to investigate templates Related to the template RuntimeError A bug in Scriggo caused an error/panic at runtime labels Jun 8, 2022
@zapateo zapateo self-assigned this Jun 8, 2022
@zapateo zapateo changed the title Runtime panic in template (needs investigation) Runtime panic in template related to defer (needs investigation) Jun 8, 2022
@zapateo
Copy link
Member Author

zapateo commented Jun 8, 2022

Note that this issue can be reduced to this:

"https://github.com/open2b/scriggo/issues/936": {
	sources: fstest.Files{
		"index.txt": `{%%
			var f = func() {
				defer func() { }()
				return
			}
			f()
		%%}some text`,
	},
},

@zapateo zapateo removed their assignment Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug: something already implemented does not work as it should needsInvestigation Need to investigate RuntimeError A bug in Scriggo caused an error/panic at runtime templates Related to the template
Projects
None yet
Development

No branches or pull requests

1 participant