diff options
author | kpdecker <kpdecker@gmail.com> | 2014-11-29 18:19:52 -0600 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2014-11-29 18:20:11 -0600 |
commit | f84f76f006a7992d9f82d14f4ebff64687fefa05 (patch) | |
tree | dfe875d1e1c246093ac355cab670970d7b5628e8 /lib/handlebars/compiler/javascript-compiler.js | |
parent | 96c1300f15968e937f170385ae52b633f7fa5019 (diff) | |
download | handlebars.js-f84f76f006a7992d9f82d14f4ebff64687fefa05.zip handlebars.js-f84f76f006a7992d9f82d14f4ebff64687fefa05.tar.gz handlebars.js-f84f76f006a7992d9f82d14f4ebff64687fefa05.tar.bz2 |
Add basic docs for JavaScriptCompiler override API
Diffstat (limited to 'lib/handlebars/compiler/javascript-compiler.js')
-rw-r--r-- | lib/handlebars/compiler/javascript-compiler.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/handlebars/compiler/javascript-compiler.js b/lib/handlebars/compiler/javascript-compiler.js index 6703b44..537d1b0 100644 --- a/lib/handlebars/compiler/javascript-compiler.js +++ b/lib/handlebars/compiler/javascript-compiler.js @@ -29,23 +29,23 @@ JavaScriptCompiler.prototype = { return [revision, versions]; }, - appendToBuffer: function(string, location, explicit) { - // Force a string as this simplifies the merge logic. - if (!isArray(string)) { - string = [string]; + appendToBuffer: function(source, location, explicit) { + // Force a source as this simplifies the merge logic. + if (!isArray(source)) { + source = [source]; } - string = this.source.wrap(string, location); + source = this.source.wrap(source, location); if (this.environment.isSimple) { - return ['return ', string, ';']; + return ['return ', source, ';']; } else if (explicit) { // This is a case where the buffer operation occurs as a child of another // construct, generally braces. We have to explicitly output these buffer // operations to ensure that the emitted code goes in the correct location. - return ['buffer += ', string, ';']; + return ['buffer += ', source, ';']; } else { - string.appendToBuffer = true; - return string; + source.appendToBuffer = true; + return source; } }, |