Lucee doesn't show Filename and linenumbers on getComponentMetadata(InvalidComponent)

Description

GetComponentMetadata does not show error details when we try to get metadata of a component which has syntax errors. It wil fail with this error
lucee.transformer.bytecode.statement.ExpressionAsStatement cannot be cast to lucee.transformer.bytecode.statement.tag.TagComponent
Problem ONLY occurs when component definition is not on one line.
So

is OK, but

will fail. This is especially annoying in large projects using wirebox, since it is using getComponentMetaData all the time. It makes it almost impossible to track syntax errors.
Tools like cfformat will often break component definitions on multiple lines.

Environment

None

Activity

Show:
Wil de Bruin
September 12, 2020, 7:49 PM

https://github.com/wpdebruin/getComponentMetaData will show the problem in a small sample project

Pothys - MitrahSoft
September 14, 2020, 8:12 AM

I've checked this ticket and confirmed the issue happened on lucee latest version 5.3.8.70_SNAPSHOT also.
yeah, if we use component with the same line of ( { ) is OK with a syntax error.
But, use component with the next line of ( { ) means, throws an error as per the reporter said.

Pothys - MitrahSoft
September 14, 2020, 3:37 PM

I've added a test case for this ticket

Pull Request: https://github.com/lucee/Lucee/pull/1033

Assignee

Michael Offner

Reporter

Wil de Bruin

Priority

New

Labels

Fix versions

None
Configure