Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8016618

script mirror object access should be improved

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • None
    • core-libs
    • None
    • b96
    • generic
    • generic
    • Verified

      loadWithNewGlobal function as well as evaluating script using ScriptEngine's eval methods return ScriptObject instances as ScriptObjectMirror instances. Right now, property and method call access on ScriptObjectMirror objects are supported by JSObjectLinker. This provides natural syntax to access "foreign"/"mirror" objects from scripts. Also delete is supported. But we need bit more support for nodejar:

      * support for instanceof operator b/w mirror objects
      * support for array-like mirror objects. For eg. Array.prototype generic functions could work well on array-like mirror objects. Function.apply could accept array-like mirror object for arguments.
      * passing current global's functions as callbacks to mirror Array.prototype functions
      * Support JS Object "static" methods such as Object.keys etc. on mirrors.

      Please note that it is not possible/desirable to support all JS APIs on mirror objects. But a useful subset of Array.prototype and Object functions would be very useful.

            sundar Sundararajan Athijegannathan
            sundar Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: