JDK-8080848 : delete of bound Java method property results in crash
  • Type: Bug
  • Component: core-libs
  • Sub-Component: jdk.nashorn
  • Affected Version: 8u60,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2015-05-21
  • Updated: 2015-09-29
  • Resolved: 2015-05-21
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.

To download the current JDK release, click here.
JDK 8 JDK 9
8u60Fixed 9 b66Fixed
Description
File: deletebound.js
-----------------------------

var obj = Object.bindProperties({},
    java.lang.System.console());

delete obj.wait;


jjs -J-Djava.ext.dirs=dist   deletebound.js 
Exception in thread "main" java.lang.NullPointerException
	at jdk.nashorn.internal.runtime.AccessorProperty.invokeSetter(AccessorProperty.java:488)
	at jdk.nashorn.internal.runtime.AccessorProperty.setValue(AccessorProperty.java:517)
	at jdk.nashorn.internal.runtime.ScriptObject.erasePropertyValue(ScriptObject.java:917)
	at jdk.nashorn.internal.runtime.ScriptObject.deleteOwnProperty(ScriptObject.java:929)
	at jdk.nashorn.internal.runtime.ScriptObject.deleteObject(ScriptObject.java:3673)
	at jdk.nashorn.internal.runtime.ScriptObject.delete(ScriptObject.java:3654)
	at jdk.nashorn.internal.runtime.ScriptRuntime.DELETE(ScriptRuntime.java:659)
	at jdk.nashorn.internal.scripts.Script$Recompilation$3$deletebound$cu1$restOf.:program(deletebound.js:4)
	at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:640)
	at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:228)
	at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
	at jdk.nashorn.tools.Shell.apply(Shell.java:397)
	at jdk.nashorn.tools.Shell.runScripts(Shell.java:326)
	at jdk.nashorn.tools.Shell.run(Shell.java:172)
	at jdk.nashorn.tools.Shell.main(Shell.java:136)
	at jdk.nashorn.tools.Shell.main(Shell.java:112)