Skip to content

compiler: invalid handling of variables imported from template files and used in macros #962

@zapateo

Description

@zapateo

The issue #852 was fixed and tests were added, but these tests do not seem to be extensive enough, and therefore panics occur in the runtime (and possibly in the disassembler).

To reproduce such panics:

"https://github.com/open2b/scriggo/issues/852 - Additional tests #1": {
	sources: fstest.Files{
		"index.html":    `{% import pkg "imported.html" %}a{% macro M %}b{{ pkg.V }}c{% end macro %}d{{ M() }}`,
		"imported.html": `{% var V int %}`,
	},
	expectedOut: "TODO",
},

"https://github.com/open2b/scriggo/issues/852 - Additional tests #2": {
	sources: fstest.Files{
		"index.html":    `{% import pkg "imported.html" %}a{% macro M %}b{{ pkg.V }}c{% end macro %}d{{ M() }}`,
		"imported.html": `{% var V int = 42 %}`,
	},
	expectedOut: "TODO",
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    RuntimeErrorA bug in Scriggo caused an error/panic at runtimecritical-bugA critical bug, that is a bug that takes precedence over other bugs (for example cannot be bypassed)disassemblerRelated to disassemblerneedsInvestigationNeed to investigatetemplatesRelated to the template

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions