2

I'm trying to assign a string literal to a variable using a ternary operator with the following code in the pre block:

texta = "approve";
textd = "deny";
aAction = texta eq "approve" => "true" | "false";
dAction = textd eq "approve" => "true" | "false";

However, this is what comes across in the JavaScript:

var texta = 'approve';
var textd = 'deny';
var aAction = true;
var dAction = false;

Notice that aAction and dAction should be strings, but they are actually boolean literals.

Why is this happening?

Steve Nay
  • 2,819
  • 1
  • 30
  • 41
  • Is there more to the rule? This is a bug that I will have to trace to find out where it is getting expressed as a boolean – MEH Apr 05 '11 at 23:35
  • A single rule. Here's the whole ruleset: http://pastie.org/1761173 – Steve Nay Apr 06 '11 at 00:10

1 Answers1

2

One way to force it back into a string is with a beesting:

aActionStr = "#{aAction}";
dActionStr = "#{dAction}";

Doesn't answer the question as to why this happens, but it's a hack that will work in this case.

Steve Nay
  • 2,819
  • 1
  • 30
  • 41