- Mastering Java 11
- Dr. Edward Lavieri
- 81字
- 2025-02-25 06:41:47
Proof of concept
Nashorn is a lightweight, high-performance, JavaScript runtime that permits embedding JavaScript in Java applications. This was created for Java 8 and replaced the previous JavaScript scripting engine that was based on Mozilla Rhino. Nashorn already has this functionality. It provides linkage between high-level operations on any object of unknown types, such as obj.something, where it produces the following:
INVOKEDYNAMIC "dyn.getProp.something"
The dynamic linker springs into action and provides, when possible, the appropriate implementation.