글로벌 함수에서 heredoc에서 베 스트링을 사용하는 데 문제가 있습니다. 런타임에서 "Exception: arg2 is not defined
"오류가 발생합니다. 그것은 결코 약 arg1
는 일반 문자열 안에 beesting를 사용하여 잘 것을 보여주는, 정의되어 있지 않다고 불평하지글로벌 함수 내에서 heredoc의 베시
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;
}
}
예를 들면 다음과 같습니다.
내가 잘못하고있는 것이 있습니까? 아니면이 버그입니까?
코드 예제를 게시 할 때 보너스 포인트 (가상 어쨌든 ...). 질문에 답하는 것이 훨씬 쉽습니다! – TelegramSam