nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptingFunctions.java
changeset 29282 a8523237b66c
parent 26765 97501edd2979
child 30700 b60ef3a8b185
equal deleted inserted replaced
29281:8cc2618a07aa 29282:a8523237b66c
   105     public static Object readFully(final Object self, final Object file) throws IOException {
   105     public static Object readFully(final Object self, final Object file) throws IOException {
   106         File f = null;
   106         File f = null;
   107 
   107 
   108         if (file instanceof File) {
   108         if (file instanceof File) {
   109             f = (File)file;
   109             f = (File)file;
   110         } else if (file instanceof String || file instanceof ConsString) {
   110         } else if (JSType.isString(file)) {
   111             f = new java.io.File(((CharSequence)file).toString());
   111             f = new java.io.File(((CharSequence)file).toString());
   112         }
   112         }
   113 
   113 
   114         if (f == null || !f.isFile()) {
   114         if (f == null || !f.isFile()) {
   115             throw typeError("not.a.file", ScriptRuntime.safeToString(file));
   115             throw typeError("not.a.file", ScriptRuntime.safeToString(file));