twitter / hogan.js

A compiler for the Mustache templating language
http://twitter.github.io/hogan.js
Apache License 2.0
5.14k stars 431 forks source link

Ensure text of template tokens are string primitives not objects #153

Closed ahume closed 10 years ago

ahume commented 10 years ago

I don't know if there's a specific reason for text fields to be handled as string objects vs primitives. In general it probably makes them more difficult to work with (see the conversions that are currently required in tests for example). Would be interested to know the reason.

There's a bug in recent Canary builds (reported to Google, possibly V8 JIT bug) which is causing an "illegal access" error when concatenating these strings without explicitly converting to a primitive first. This fixes that - but I guess there's some potentially backward breaking changes here if you were doing certain things and expecting typeof object?

sayrer commented 10 years ago

There was a reason we did this--although it escapes me now :/

Re-open if you disagree.