lastModified() now returns a double value
added toString() so that filename is printed as default value
This commit is contained in:
stefanp 2004-02-19 18:12:16 +00:00
parent df1c131648
commit 53a34d861a

View file

@ -82,6 +82,7 @@ public class FileObject extends ScriptableObject {
FunctionObject ctor = new FunctionObject("File", ctorMember, scope); FunctionObject ctor = new FunctionObject("File", ctorMember, scope);
ctor.addAsConstructor(scope, proto); ctor.addAsConstructor(scope, proto);
String[] fileFuncs = { String[] fileFuncs = {
"toString",
"getName", "getName",
"getParent", "getParent",
"isAbsolute", "isAbsolute",
@ -325,9 +326,9 @@ public class FileObject extends ScriptableObject {
public double lastModified() { public double lastModified() {
if (file == null) { if (file == null) {
setError(new IllegalArgumentException("Uninitialized File object")); setError(new IllegalArgumentException("Uninitialized File object"));
return (short) 0L; return (double) 0L;
} }
return (short) file.lastModified(); return (double) file.lastModified();
} }
public String error() { public String error() {