Closed apipkin closed 10 years ago
Why are we throwing all these errors inside an HB helper like this? Won't the underlying built-in and polyfil APIs throw these errors?
@ericf the errors thrown are for using the helpers incorrectly. By checking the last parameter's existence, you can infer the accurate number of parameters were not provided. Since handlebars adds the options
to the end of the helpers call, it missing means the first option was not provided – thus using it incorrectly.
{{intlNumber format="dollahs"}}
vs {{intNumber 3 format="dollahs"}}
If the helpers do not throw, they should at the very least fail silently. But I highly favor throwing.
+1
Add _mix helper Throws proper errors Fix locale arguments for locale look up