fluent.js icon indicating copy to clipboard operation
fluent.js copied to clipboard

MessageReference as Selector is invalid

Open zbraniecki opened this issue 6 years ago • 2 comments

https://github.com/projectfluent/fluent.js/blob/5fb64c577ac43e05a14b937a3a006f604a763b42/fluent/test/primitives_test.js#L138

Shouldn't this be invalid because MessageReference cannot be used as Selector?

zbraniecki avatar Apr 09 '19 17:04 zbraniecki

It should be, yes. A Term Attribute reference would be OK, though.

https://github.com/projectfluent/fluent/blob/c480d01cf68a5f3afae613ad7243588b486023f8/syntax/abstract.mjs#L60-L61

Pike avatar Apr 09 '19 18:04 Pike

The fluent runtime package takes shortcuts when parsing and resolving to avoid the perf cost of being 100% correct. There shouldn't be any tests which rely on this behavior; what you found is a bug in the test, thanks for finding it.

stasm avatar Apr 09 '19 19:04 stasm