diff options
author | kpdecker <kpdecker@gmail.com> | 2015-08-03 12:13:24 -0500 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2015-08-03 12:13:24 -0500 |
commit | 9f265b97614e5c4763dc3d2d7343fc2472a6cc1a (patch) | |
tree | b3303688c8fcf8e954771ceeae77dae862a2aec2 /lib/handlebars/compiler/compiler.js | |
parent | 0aa54f49de111d117e7d3b4a21e99b9fcaf483d1 (diff) | |
download | handlebars.js-9f265b97614e5c4763dc3d2d7343fc2472a6cc1a.zip handlebars.js-9f265b97614e5c4763dc3d2d7343fc2472a6cc1a.tar.gz handlebars.js-9f265b97614e5c4763dc3d2d7343fc2472a6cc1a.tar.bz2 |
Handle this references properly in track id mode
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r-- | lib/handlebars/compiler/compiler.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js index 2448443..c1ef47e 100644 --- a/lib/handlebars/compiler/compiler.js +++ b/lib/handlebars/compiler/compiler.js @@ -390,8 +390,9 @@ Compiler.prototype = { value = val.original || value; if (value.replace) { value = value - .replace(/^\.\//g, '') - .replace(/^\.$/g, ''); + .replace(/^this(?:\.|$)/, '') + .replace(/^\.\//, '') + .replace(/^\.$/, ''); } this.opcode('pushId', val.type, value); |