summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/javascript-compiler.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2015-08-03 15:15:09 -0500
committerkpdecker <kpdecker@gmail.com>2015-08-03 15:15:09 -0500
commit279e038ba7ff7e5966a60e36d326e2d4c310f0c6 (patch)
treefe96ba921f7f8dde4492df5ecbb761d8290f837f /lib/handlebars/compiler/javascript-compiler.js
parent1c08771215af7377fb8f33a26f64b3af0e06c168 (diff)
downloadhandlebars.js-279e038ba7ff7e5966a60e36d326e2d4c310f0c6.zip
handlebars.js-279e038ba7ff7e5966a60e36d326e2d4c310f0c6.tar.gz
handlebars.js-279e038ba7ff7e5966a60e36d326e2d4c310f0c6.tar.bz2
Avoid depth creation when context remains the same
Creating a new depth value seems to confuse users as they don’t expect things like `if` to require multiple `..` to break out of. With the change, we avoid pushing a context to the depth list if it’s already on the top of the stack, effectively removing cases where `.` and `..` are the same object and multiple `..` references are required. This is a breaking change and all templates that utilize `..` will have to check their usage and confirm that this does not break desired behavior. Helper authors now need to take care to return the same context value whenever it is conceptually the same and to avoid behaviors that may execute children under the current context in some situations and under different contexts under other situations. Fixes #1028
Diffstat (limited to 'lib/handlebars/compiler/javascript-compiler.js')
0 files changed, 0 insertions, 0 deletions