-
Enhancement
-
Resolution: Fixed
-
P3
-
None
-
9
-
None
-
generic
-
generic
BeansLinker is ordinarily near the bottom of the linker chain, and currently it has a hard-wired behavior for linking variable-named getters on non-existent properties: return null. (It also has a hard-wired behavior for linking linking variable-named getters on non-existent properties: do nothing.)
Nashorn, as well as other languages, could benefit from providing configurable behavior for this situation. Nashorn specifically could finally resolveJDK-8057173.
We basically need a constructor for beans linker that takes something that can create handlers for "no such member" on demand; a (linkRequest, linkerServices)->methodHandle function. Note that this looks very similar to GuardingDynamicLinker, which is a (linkRequest, linkerServices)->guardedInvocation. It is deliberate that this should only return a methodHandle as BeansLinker internally deals with "guarded invocation components", which are more generic than method handles but less generic than guarded invocations. If we don't want to expose that whole machinery in the API, we can only use a function that returns a method handle.
Nashorn, as well as other languages, could benefit from providing configurable behavior for this situation. Nashorn specifically could finally resolve
We basically need a constructor for beans linker that takes something that can create handlers for "no such member" on demand; a (linkRequest, linkerServices)->methodHandle function. Note that this looks very similar to GuardingDynamicLinker, which is a (linkRequest, linkerServices)->guardedInvocation. It is deliberate that this should only return a methodHandle as BeansLinker internally deals with "guarded invocation components", which are more generic than method handles but less generic than guarded invocations. If we don't want to expose that whole machinery in the API, we can only use a function that returns a method handle.
- relates to
-
JDK-8057173 Treat POJOs as Object.seal()'d JS objects
-
- Closed
-