Skip to content

Commit

Permalink
Can't double Stringify. Fix for issue tropo#7 and others.
Browse files Browse the repository at this point in the history
Inline if statements for objects were not firing before for some
properties due to case sensitivity.
  • Loading branch information
Maxattax97 committed Jan 23, 2016
1 parent 9951d79 commit 65394e4
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
*
*/
Ask = function(choices, attempts, bargein, minConfidence, name, recognizer, required, say, timeout, voice, interdigitTimeout, sensitivity, speechCompleteTimeout, speechIncompleteTimeout) {
this.choices = (say.event !== null) ? choices : serializeProperty(choices);
this.choices = choices
this.attempts = attempts;
this.bargein = bargein;
this.minConfidence = minConfidence;
this.name = name;
this.recognizer = recognizer;
this.required = required;
this.say = (say.event !== null) ? say : serializeProperty(say);
this.say = say
this.timeout = timeout;
this.voice = voice;
this.interdigitTimeout = interdigitTimeout;
Expand All @@ -24,10 +24,10 @@ Call = function(to, answerOnMedia, channel, from, headers, name, network, record
this.answerOnMedia = answerOnMedia;
this.channel = channel;
this.from = from;
this.headers = serializeProperty(headers);
this.headers = headers;
this.name = name;
this.network = network;
this.recording = (typeof(recording) == 'Object') ? serializeProperty(recording) : recording;
this.recording = recording;
this.required = required;
this.timeout = timeout;
this.allowSignals = allowSignals;
Expand Down Expand Up @@ -71,7 +71,7 @@ MachineDetection = function(introduction, voice){
}

Message = function(say, to, answerOnMedia, channel, from, name, network, required, timeout, voice) {
this.say = serializeProperty(say);
this.say = say;
this.to = to;
this.answerOnMedia = answerOnMedia;
this.channel = channel;
Expand All @@ -88,7 +88,7 @@ On = function(event, name, next, required, say, ask, message, wait) {
this.name = name;
this.next = next;
this.required = required;
this.say = (typeof(say) == 'Object') ? serializeProperty(say) : say;
this.say = say;
this.ask = ask;
this.message = message;
this.wait = wait;
Expand All @@ -98,17 +98,17 @@ Record = function(attempts, bargein, beep, choices, format, maxSilence, maxTime,
this.attempts = attempts;
this.bargein = bargein;
this.beep = beep;
this.choices = serializeProperty(choices);
this.choices = choices
this.format = format;
this.maxSilence = maxSilence;
this.maxTime = maxTime;
this.method = method;
this.minConfidence = minConfidence;
this.name = name;
this.required = required;
this.say = serializeProperty(say);
this.say = say
this.timeout = timeout;
this.transcription = (typeof(transcription) == 'Object') ? serializeProperty(transcription) : transcription;
this.transcription = transcription;
this.url = url;
this.password = password;
this.username = username;
Expand Down Expand Up @@ -197,9 +197,9 @@ StopRecording = function() {};
Transfer = function(to, answerOnMedia, choices, from, headers, name, on, required, terminator, timeout, allowSignals, interdigitTimeout, ringRepeat, machineDetection) {
this.to = to;
this.answerOnMedia = answerOnMedia;
this.choices = serializeProperty(choices);
this.choices = choices;
this.from = from;
this.headers = serializeProperty(headers);
this.headers = headers;
this.name = name;
if(typeof(on) == "Array"){
this.on = "";
Expand All @@ -210,7 +210,7 @@ Transfer = function(to, answerOnMedia, choices, from, headers, name, on, require
}

}else{
this.on = (typeof(on) == 'Object') ? serializeProperty(on) : on;
this.on = on;
}
this.required = required;
this.terminator = terminator;
Expand Down

0 comments on commit 65394e4

Please sign in to comment.