title: Nashorn no longer working with BigDecimal
body: <p>We upgraded from Oracle JDK 8u77 to 8u92 and suddenly scripts that were previously working no longer work. A minimal reproducer is:</p>
  
  <pre><code>Map&lt;String, Object&gt; attributes = Collections.singletonMap("GROSSREIMBAMOUNT", BigDecimal.ZERO);
  String script = "GROSSREIMBAMOUNT.toFixed(2)";
  
  ScriptEngineManager mgr = new ScriptEngineManager();
  ScriptEngine jsEngine = mgr.getEngineByName("JavaScript");
  
  for (Entry&lt;String, Object&gt; entry : attributes.entrySet()) {
    jsEngine.put(entry.getKey(), entry.getValue());
  }
  
  System.out.println(jsEngine.eval(script));
  </code></pre>
  
  <p>Previously we got</p>
  
  <pre><code>0.00
  </code></pre>
  
  <p>But now we're getting.</p>
  
  <pre><code>TypeError: GROSSREIMBAMOUNT.toFixed is not a function
  </code></pre>
  
  <p><code>typeof</code> now returns <code>object</code> where it would previously return <code>number</code>.</p>
  
  <p>My question is this behavior intentional or a bug? I first though this would be a bug but <a href="https://bugs.openjdk.java.net/browse/JDK-8010732" rel="noreferrer">JDK-8010732</a> seems to suggest otherwise.</p>