11ty / webc

Single File Web Components
MIT License
1.3k stars 36 forks source link

fix: Use consistent language in `AttributeSerializer` error message #169

Closed Zearin closed 1 year ago

Zearin commented 1 year ago

I’m still learning WebC, so I did something wrong while trying to convert one of my projects. :)

However, I noticed that the error message said the following:

Original error stack trace: Error: Evaluating a dynamic attribute failed: `:@text="data.x"`.

According to the docs, a dynamic attribute has just the : prefix, but a dynamic property (“prop”) has the :@ prefix.

Since my error was caused by a dynamic prop, I thought I would make the error message use language that matches.

I also added a simple test to verify that the different error message is applied when appropriate.