RFR 8085937: add autoimports sample script to easily explore Java classes in interactive mode
sundararajan.athijegannathan at oracle.com
Mon Jun 8 08:37:38 UTC 2015
Thanks for the review. I've edited comment as suggested. Updated review @
for reference. As for == vs === , for JS primitive String comparison
both should be same.
On Monday 08 June 2015 12:37 PM, Michael Haupt wrote:
> Hi Sundar,
> note there's no capital R in my review.
>> Am 08.06.2015 um 05:03 schrieb A. Sundararajan <sundararajan.athijegannathan at oracle.com>:
>> Please review http://cr.openjdk.java.net/~sundar/8085937/ for https://bugs.openjdk.java.net/browse/JDK-8085937
> autoimports.js: There are some nits in the comment at the beginning of the file; here's an edit of the entire comment:
> It is tedious to import Java classes used in a script. Sometimes it is easier use simple names of java classes and have a script auto import Java classes. You can load this script at the start of an interactive jjs session or at the start of your script. This script defines a __noSuchProperty__ hook to auto import Java classes as
> needed and when they are referred to for the first time in your script. You can also call the "autoimports" function to print script statements that you need to use in your script, i.e., have the function generate a script to import Java classes used by your script so far. After running your script, you can call autoimports to get the exact Java imports you need and replace the autoimports load with the generated import statements (to avoid costly init of the autoimports script).
> autoimports.js, lines 136, 140: use === rather than ==?
> Other than that, no remarks!
More information about the nashorn-dev