Packages

frank.westlake at gmail.com frank.westlake at gmail.com
Mon May 13 05:01:14 PDT 2013


If Nashorn doesn't already have this ability please  
consider making 'Packages' configurable -- perhaps by a  
system property. My hope is that I can add 'android' to  
the list so that I can use it without it being prefixed  
with 'Packages'. For example:

  // In the host application:
  java.lang.System.setProperty(keyAdditionalPackages, "android, js");

  // In the script:
  var x=android.content.Intent.ACTION_SCREEN_OFF;

In the past I have done the following, but it produced  
conflicts so I have abandoned it:

  // In the script:
  const android=Packages.android;
  var x=android.content.Intent.ACTION_SCREEN_OFF;

  // Conflicts with:
  // var y=Packages.android.content.Intent.ACTION_SCREEN_ON;

I apologize if this is already available -- I am not a  
programmer.

Frank


More information about the nashorn-dev mailing list