在空手道v1.1.0 org.graalvm.polyglot.polyglotexception中获得错误
我正在使用空手道v0.9.6这一切。最近,我已经升级到版本1.1.0,
一件事令人不安的是ballows,
* def responsevalue = response.body
* def length = responsevalue.length
* def number = []
* eval for(var i = 0;i < length; i++) if(response.body[i].availablenumber > 10000) number.add(response.body[i].Id)
error : - org.graalvm.polyglot.polyglotexception:typeError:typeError:InvokeMember:InvokeMember(add)在[]上失败。 :不支持消息。
我敢肯定,我缺少发行说明中的重要部分。我真的很感谢您解决这个问题的任何解决方案。
非常感谢!
I was using Karate v0.9.6 all this while. Recently I have upgraded to the version 1.1.0
One thing is troubling a lot is as bellows,
* def responsevalue = response.body
* def length = responsevalue.length
* def number = []
* eval for(var i = 0;i < length; i++) if(response.body[i].availablenumber > 10000) number.add(response.body[i].Id)
Error:- org.graalvm.polyglot.PolyglotException: TypeError: invokeMember (add) on [] failed due to: Message not supported.
I'm sure I'm missing important part from the release notes. I would really appreciate any solution to this problem.
Many Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,我想说不建议这样的循环。使用
filter()
操作:请参阅: https:// github。 com/karatelabs/karate#json-transforms
无论如何,您需要做的更改是:
number.push()
而不是number.add()
: https://github.com/karatelabs/karate/wiki/wiki/wiki/wiki/wiki/wiki/wiki-guide-guide#java-api-s-for-maps-maps-maps-and-list-list-list-list-list-ares-are-no-no-no-no-no-no-no-longer-visible-within-js blocksFirst I'd like to say that loops like this are not recommended. Use
filter()
operations instead:Refer: https://github.com/karatelabs/karate#json-transforms
Anyway, the change you need to make is :
number.push()
instead ofnumber.add()
: https://github.com/karatelabs/karate/wiki/1.0-upgrade-guide#java-api-s-for-maps-and-lists-are-no-longer-visible-within-js-blocks