简体   繁体   English

Nashorn:使用源地图

[英]Nashorn: use of source maps

I'm currently using typescript for client side development and java for server side (Maven Project). 我目前正在使用typescript进行客户端开发,使用java进行服务器端(Maven Project)。 Now I'd like to create a @Parametrized JUnit test, which runs my typescript tests. 现在我想创建一个@Parametrized JUnit测试,它运行我的打字稿测试。 For now i am compiling the Typescript into the target/test-classes folder and load them via ScriptRunner using eval. 现在我正在将Typescript编译到target / test-classes文件夹中,并使用eval通过ScriptRunner加载它们。 In case of an exception, you get the stack trace of the js file. 如果发生异常,您将获得js文件的堆栈跟踪。 Does anyone know a way to use the ts files (so tell nashorn to use the resource map)? 有没有人知道使用ts文件的方法(所以告诉nashorn使用资源图)? I would also like to ask if you know any way of debugging this (like jumping between js/ts and java code) inside Eclipse. 我还想问一下你是否知道在Eclipse中调试这个方法(比如在js / ts和java代码之间跳转)。

No, nashorn supports //@sourceURL=foo [ and //#sourceURL=foo ] directive to set the source URL to be used for reported errors. 不,nashorn支持// @ sourceURL = foo [和//#sourceURL = foo]指令来设置用于报告错误的源URL。 Nashorn does not load/parse source maps. Nashorn不加载/解析源映射。 You need to explicitly map to source by reading javax.script.ScriptException or it's cause exception jdk.nashorn.api.scripting.NashornException in your embedding code. 您需要通过读取javax.script.ScriptException显式映射到源,否则会导致嵌入代码中出现异常jdk.nashorn.api.scripting.NashornException。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM