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

BrowserJSObjectLinker should give priority to beans linker for property get/set

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • None
    • core-libs
    • b44
    • generic
    • generic

        For object property get and set BrowserJSObjectLinker should give priority to beans linker. If there is a matching bean style property, that should be linked. Only when no matching property is found or if the access is indexed access, then BrowserJSObjectLinker should use JSObject.getMember/getSlot and JSObject.setMember/setSlot methods.

        This is because bean style properties are strongly typed and so script value to required Java side value conversion can happen. For example, JavaFX WebView HTML button class implements JSObject - but has strongly typed getter/setter for many properties. "onclick" property accepts EventHandler object (which is a SAM type). With bean property getting priority, Nashorn can allow script writer to set "onclick" with script function value. script function to EventHandler SAM conversion occurs - because of existing target type conversion scheme. Without priority to beans linker, script writer has to explicitly convert script function to EventHandler (because JSObject methods accept Object and hence no target type conversion).

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

                Created:
                Updated:
                Resolved: