1
0
Fork 0

fixed failing tests

This commit is contained in:
Jan Steemann 2014-01-30 23:12:40 +01:00
parent a792adec39
commit 7bc4f06b6e
2 changed files with 14 additions and 7 deletions

View File

@ -2459,8 +2459,10 @@ static v8::Handle<v8::Value> JS_FirstQuery (v8::Arguments const& argv) {
// if argument is supplied, we'll return a list - otherwise we simply return the first doc
if (argv.Length() == 1) {
count = TRI_ObjectToInt64(argv[0]);
returnList = true;
if (! argv[0]->IsUndefined()) {
count = TRI_ObjectToInt64(argv[0]);
returnList = true;
}
}
if (count < 1) {
@ -2714,8 +2716,10 @@ static v8::Handle<v8::Value> JS_LastQuery (v8::Arguments const& argv) {
// if argument is supplied, we'll return a list - otherwise we simply return the last doc
if (argv.Length() == 1) {
count = TRI_ObjectToInt64(argv[0]);
returnList = true;
if (! argv[0]->IsUndefined()) {
count = TRI_ObjectToInt64(argv[0]);
returnList = true;
}
}
if (count < 1) {

View File

@ -324,11 +324,12 @@ ArangoCollection.prototype.first = function (count) {
var body = JSON.parse(results[i].body);
return body.result || null;
}
return null;
}
else {
return this.FIRST(count);
}
return null;
};
////////////////////////////////////////////////////////////////////////////////
@ -336,7 +337,7 @@ ArangoCollection.prototype.first = function (count) {
///
/// @FUN{@FA{collection}.last(@FA{count})}
///
/// The @FN{first} method returns the n last documents from the collection, in
/// The @FN{lst} method returns the n last documents from the collection, in
/// order of document insertion/update time.
///
/// If called with the @FA{count} argument, the result is a list of up to
@ -405,7 +406,9 @@ ArangoCollection.prototype.last = function (count) {
}
else {
return this.LAST(count);
}
}
return null;
};
////////////////////////////////////////////////////////////////////////////////