JDK-8186011 : Fix samples/java_completion.js and samples/disassemble.js
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: jdk.nashorn
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-08-09
  • Updated: 2017-09-29
  • Resolved: 2017-09-25
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 10
10 b25Fixed
Description
samples/java_completion.js  and samples/disassemble.js seems broken.

Beow are quick observations from sundar:
samples/java_completion.js : it has to call continuation method - it used to be a property, API changed
diff -r bece58f76216 samples/java_completion.js
--- a/samples/java_completion.js    Thu Jul 20 21:12:24 2017 +0000
+++ b/samples/java_completion.js    Wed Aug 09 08:37:49 2017 +0530
@@ -38,4 +38,4 @@
var analysis = repl.sourceCodeAnalysis()
var code = "System."
var suggestions = analysis.completionSuggestions(code, code.length, [0])
-suggestions.forEach(function(s) print(s.continuation))
+suggestions.forEach(s => print(s.continuation()))

disassemble.js sample should be removed. It does not work with jdk9's modular system