graalvm / graal-js-jdk11-maven-demo

An example project how to run Graal/JavaScript on JDK 11 with Graal as optimizing JIT compiler for best performance.
Universal Permissive License v1.0
177 stars 63 forks source link

Giving the script a name #14

Closed JaroslavTulach closed 5 years ago

JaroslavTulach commented 5 years ago

When debugging on GraalVM 1.0.0rc9 and in NetBeans 10 I don't see the SOURCE as JavaScript. Probably because it is Unnamed without any extension. Giving it app.js name fixes the problem.

To reproduce start NetBeans 10 as:

graal-js-jdk11-maven-demo$ netbeans --jdkhome /graalvm/ --userdir /tmp/gvmud .

put breakpoint before eval and invoke Debug Project action. Once the breakpoint (in Java code) is hit, use the new Toggle pause in GraalVM script action in debugger toolbar and once enabled, Continue. The execution stops at first line of your JavaScript. Since then your mixed Java+JavaScript debugging becomes reality, but it is better to see the source as JavaScript than unnamed one. For example the former allows one to add JavaScript breakpoints.

CC @entlicher, @geertjanw as this could be very nice demo showing how OracleLabs contribute to polyglot features of the IDE once NetBeans 10 is out.