nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptingFunctions.java
equal
deleted
inserted
replaced
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)); |