Strict eval creates a new scope to avoid spilling declarations in the containing scope. It uses global.newObject() to create the scope object, which returns a generic JavaScript object. However, Nashorn splitter expects scopes to implement the Scope interface. Loading a very large script that require splitting therefore leads to a ClassCastException: jjs> "use strict"; var s = readFully("../octane/mandreel.js"); eval(s); java.lang.ClassCastException: jdk.nashorn.internal.scripts.JD cannot be cast to jdk.nashorn.internal.runtime.Scope