JDK-8067136 : BrowserJSObjectLinker does not handle call on JSObjects
Type:Bug
Component:core-libs
Sub-Component:jdk.nashorn
Priority:P3
Status:Resolved
Resolution:Fixed
OS:generic
CPU:generic
Submitted:2014-12-10
Updated:2015-06-04
Resolved:2014-12-10
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
BrowserJSObjectLinker does not handle "call" on JSObjects. A JSObject get property may result in another JSObject that is callable (function in browser's script engine perhaps). BrowserJSObjectLinker does not handle it.
Comments
When running browser_dom.js (attachment), I get the following exception:
Exception in thread "JavaFX Application Thread" browser_dom.js:43 TypeError: function createElement() {
[native code]
} is not a function
at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:213)
at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:185)
at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:172)
at jdk.nashorn.internal.runtime.linker.NashornBottomLinker.linkBean(NashornBottomLinker.java:120)
at jdk.nashorn.internal.runtime.linker.NashornBottomLinker.getGuardedInvocation(NashornBottomLinker.java:75)
at jdk.internal.dynalink.support.CompositeGuardingDynamicLinker.getGuardedInvocation(CompositeGuardingDynamicLinker.java:124)
at jdk.internal.dynalink.support.LinkerServicesImpl.getGuardedInvocation(LinkerServicesImpl.java:149)
[...]
createElement being a function in browser JS engine on "document" object. Nashorn does not treat resulting JSObject value as callable.