Make return values more "JavaScript compatible" (long->double, String[]-> Object)
to make them work with recent rhino snapshots.
This commit is contained in:
parent
1e75ca9b90
commit
87aca52907
1 changed files with 5 additions and 5 deletions
|
@ -314,7 +314,7 @@ public class FileObject extends ScriptableObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public long getLength() {
|
public double getLength() {
|
||||||
if (file == null) {
|
if (file == null) {
|
||||||
setError(new IllegalArgumentException("Uninitialized File object"));
|
setError(new IllegalArgumentException("Uninitialized File object"));
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -322,12 +322,12 @@ public class FileObject extends ScriptableObject {
|
||||||
return file.length();
|
return file.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
public long lastModified() {
|
public double lastModified() {
|
||||||
if (file == null) {
|
if (file == null) {
|
||||||
setError(new IllegalArgumentException("Uninitialized File object"));
|
setError(new IllegalArgumentException("Uninitialized File object"));
|
||||||
return 0L;
|
return (short) 0L;
|
||||||
}
|
}
|
||||||
return file.lastModified();
|
return (short) file.lastModified();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String error() {
|
public String error() {
|
||||||
|
@ -440,7 +440,7 @@ public class FileObject extends ScriptableObject {
|
||||||
return file.mkdirs(); // Using multi directory version
|
return file.mkdirs(); // Using multi directory version
|
||||||
}
|
}
|
||||||
|
|
||||||
public String [] list() {
|
public Object list() {
|
||||||
if (file == null) return null;
|
if (file == null) return null;
|
||||||
if(readerWriter != null) return null;
|
if(readerWriter != null) return null;
|
||||||
if (!file.isDirectory()) return null;
|
if (!file.isDirectory()) return null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue