diff options
author | Parker Selbert <parker@sorentwo.com> | 2013-05-23 16:18:53 -0500 |
---|---|---|
committer | Parker Selbert <parker@sorentwo.com> | 2013-08-14 22:11:59 -0500 |
commit | d02c90c0fbc984523a7a8950e15435938979acbe (patch) | |
tree | 78ee38b05556ea482e6938777556c180bc74ae98 /lib/handlebars/compiler/javascript-compiler.js | |
parent | 860853ddb4ed4cce3a54bbf070bdfb2e07320633 (diff) | |
download | handlebars.js-d02c90c0fbc984523a7a8950e15435938979acbe.zip handlebars.js-d02c90c0fbc984523a7a8950e15435938979acbe.tar.gz handlebars.js-d02c90c0fbc984523a7a8950e15435938979acbe.tar.bz2 |
Use the ('' + string) form of string coercion
Using string.toString() will throw errors in current versions of Safari
(6.0.5 currently) for some values. The error is a particularly cryptic
"Type Error: type error", which no indication as to the value that
caused the error. By using the '' + string form of coercion the error
doesn't seem to occur.
Depending on the browser used there is a sizable performance increase
in using the concatenation form of coercion. In instances where there
is not a performance improvement (i.e. Firefox), the speed difference
is entirely negligable. See: http://jsperf.com/convert-to-string-bj/3
Diffstat (limited to 'lib/handlebars/compiler/javascript-compiler.js')
0 files changed, 0 insertions, 0 deletions