グローバル関数のヒアドキュメントでビーストを使用するのに問題があります。ランタイムはエラー" Exception: arg2 is not defined
"をスローします。次に例を示します。
ruleset a163x59 {
meta {
name "Beesting in heredoc"
description <<
Demonstrate the error with beestings in global function heredocs
>>
author "Steve Nay"
logging on
}
dispatch {
}
global {
myFunc = function(arg1, arg2) {
firstString = "This is a regular string: #{arg1}. No problem there.";
secondString = <<
This is a heredoc with a beesting: #{arg2}. Problem!
>>;
secondString;
};
}
rule first_rule {
select when pageview ".*" setting ()
pre {
msg = myFunc("First argument", "Second argument");
}
notify("Testing...", msg) with sticky = true;
}
}
未定義であることについて文句を言うことはありませんarg1
。これは、通常の文字列内でビーストを使用することが問題ないことを示しています。
私が間違っていることはありますか、それともこれはバグですか?