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

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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b44
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        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).

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: