estou recebendo em um script um array e uma variavel string. ao tentar percorrer essa array e mesclar os valores em uma string ocorre um erro que não estou conseguindo localizar.
Codigo
function run(nomeModelo, models) {
var models = JSON.parse(models);
var modelstr = "";
models.forEach( model => {
modelstr += model.model_nickname;
});
return modelstr;
}
ao executar este bloco o debug acusa:
Error
order: 0
type: “ExecuteScript”
parsedSettings: {“function”:“run”,“source”:"\nfunction run(nomeModelo, models) {\n var models = JSON.parse(models);\n var modelstr = “”;\n models.forEach( model => {\n modelstr += model.model_nickname;\n }); \n return modelstr;\n}",“inputVariables”:n“nomemodelo”,“models”],“outputVariable”:“modelslist”}
continueOnError: false
timestamp: “2019-11-12T21:32:50.470Z”
elapsedMilliseconds: 3
error: “Jint.Parser.ParserException: Line 5: Unexpected token >\n at Jint.Parser.JavaScriptParser.ThrowError(Token token, String messageFormat, ObjectE] arguments)\n at Jint.Parser.JavaScriptParser.ParsePrimaryExpression()\n at Jint.Parser.JavaScriptParser.ParseLeftHandSideExpressionAllowCall()\n at Jint.Parser.JavaScriptParser.ParsePostfixExpression()\n at Jint.Parser.JavaScriptParser.ParseUnaryExpression()\n at Jint.Parser.JavaScriptParser.ParseBinaryExpression()\n at Jint.Parser.JavaScriptParser.ParseConditionalExpression()\n at Jint.Parser.JavaScriptParser.ParseAssignmentExpression()\n at Jint.Parser.JavaScriptParser.ParseAssignmentExpression()\n at Jint.Parser.JavaScriptParser.ParseArguments()\n at Jint.Parser.JavaScriptParser.ParseLeftHandSideExpressionAllowCall()\n at Jint.Parser.JavaScriptParser.ParsePostfixExpression()\n at Jint.Parser.JavaScriptParser.ParseUnaryExpression()\n at Jint.Parser.JavaScriptParser.ParseBinaryExpression()\n at Jint.Parser.JavaScriptParser.ParseConditionalExpression()\n at Jint.Parser.JavaScriptParser.ParseAssignmentExpression()\n at Jint.Parser.JavaScriptParser.ParseExpression()\n at Jint.Parser.JavaScriptParser.ParseStatement()\n at Jint.Parser.JavaScriptParser.ParseFunctionSourceElements()\n at Jint.Parser.JavaScriptParser.ParseFunctionDeclaration()\n at Jint.Parser.JavaScriptParser.ParseSourceElements()\n at Jint.Parser.JavaScriptParser.ParseProgram()\n at Jint.Parser.JavaScriptParser.Parse(String code, ParserOptions options)\n at Jint.Engine.Execute(String source)\n at Take.Blip.Builder.Actions.ExecuteScript.ExecuteScriptAction.ExecuteAsync(IContext context, ExecuteScriptSettings settings, CancellationToken cancellationToken)\n at Take.Blip.Builder.FlowManager.ProcessActionsAsync(LazyInput lazyInput, IContext context, Actionc] actions, ICollection`1 actionTraces, CancellationToken cancellationToken)”