src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java

Print this page

        

*** 1999,2014 **** final FindProperty find = findProperty(name, true); MethodHandle mh; if (find == null) { switch (operator) { case "getProp": return noSuchProperty(desc, request); case "getMethod": return noSuchMethod(desc, request); - case "getElem": - return createEmptyGetter(desc, explicitInstanceOfCheck, name); default: throw new AssertionError(operator); // never invoked with any other operation } } --- 1999,2013 ---- final FindProperty find = findProperty(name, true); MethodHandle mh; if (find == null) { switch (operator) { + case "getElem": // getElem only gets here if element name is constant, so treat it like a property access case "getProp": return noSuchProperty(desc, request); case "getMethod": return noSuchMethod(desc, request); default: throw new AssertionError(operator); // never invoked with any other operation } }