knockout / tko

🥊 Technical Knockout – The Monorepo for Knockout.js (4.0+)
http://www.tko.io
Other
275 stars 34 forks source link

Regression: The parser seems to have troubles with German 'Umlaute' #16

Closed modeler42 closed 7 years ago

modeler42 commented 7 years ago

Observable 'ähm' works fine with Knockout 3.4 but tko throws an SyntaxError.

tko.js:4428 Uncaught Error: SyntaxError Bad operator: 'ä'. of 'foreach': ähm at Parser.parse (tko.js:4428) at Provider.getBindingAccessors (tko.js:4556) at computed.disposeWhenNodeIsRemoved (tko.js:5163) at Function.evaluateImmediate_CallReadThenEndDependencyDetection (tko.js:2854) at Function.evaluateImmediate_CallReadWithDependencyDetection (tko.js:2826) at Function.evaluateImmediate (tko.js:2790) at computed (tko.js:2651) at applyBindingsToNodeInternal (tko.js:5161) at applyBindingsToNodeAndDescendantsInternal (tko.js:4951) at applyBindingsToDescendantsInternal (tko.js:4933)

brianmhunt commented 7 years ago

Thanks @modeler42 – Good catch.

This occurs because tko is based on a strict JSON parser; the ä character is not an acceptable object key name in JSON.

Will look into this now and see if there's a simple fix.

Cheers.

brianmhunt commented 7 years ago

Fix in just-released alpha-2. Thanks for reporting!