Track stringParams mode in local state vars
This commit is contained in:
@@ -61,6 +61,7 @@ JavaScriptCompiler.prototype = {
|
||||
compile: function(environment, options, context, asObject) {
|
||||
this.environment = environment;
|
||||
this.options = options || {};
|
||||
this.stringParams = this.options.stringParams;
|
||||
|
||||
log('debug', this.environment.disassemble() + "\n\n");
|
||||
|
||||
@@ -418,7 +419,7 @@ JavaScriptCompiler.prototype = {
|
||||
emptyHash: function() {
|
||||
this.pushStackLiteral('{}');
|
||||
|
||||
if (this.options.stringParams) {
|
||||
if (this.stringParams) {
|
||||
this.push('{}'); // hashContexts
|
||||
this.push('{}'); // hashTypes
|
||||
}
|
||||
@@ -433,7 +434,7 @@ JavaScriptCompiler.prototype = {
|
||||
var hash = this.hash;
|
||||
this.hash = this.hashes.pop();
|
||||
|
||||
if (this.options.stringParams) {
|
||||
if (this.stringParams) {
|
||||
this.push('{' + hash.contexts.join(',') + '}');
|
||||
this.push('{' + hash.types.join(',') + '}');
|
||||
}
|
||||
@@ -596,7 +597,7 @@ JavaScriptCompiler.prototype = {
|
||||
context,
|
||||
type;
|
||||
|
||||
if (this.options.stringParams) {
|
||||
if (this.stringParams) {
|
||||
type = this.popStack();
|
||||
context = this.popStack();
|
||||
}
|
||||
@@ -842,7 +843,7 @@ JavaScriptCompiler.prototype = {
|
||||
|
||||
options.push("hash:" + this.popStack());
|
||||
|
||||
if (this.options.stringParams) {
|
||||
if (this.stringParams) {
|
||||
options.push("hashTypes:" + this.popStack());
|
||||
options.push("hashContexts:" + this.popStack());
|
||||
}
|
||||
@@ -871,13 +872,13 @@ JavaScriptCompiler.prototype = {
|
||||
param = this.popStack();
|
||||
params.push(param);
|
||||
|
||||
if(this.options.stringParams) {
|
||||
if(this.stringParams) {
|
||||
types.push(this.popStack());
|
||||
contexts.push(this.popStack());
|
||||
}
|
||||
}
|
||||
|
||||
if (this.options.stringParams) {
|
||||
if (this.stringParams) {
|
||||
options.push("contexts:[" + contexts.join(",") + "]");
|
||||
options.push("types:[" + types.join(",") + "]");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user