mirror of https://gitee.com/bigwinds/arangodb
fixed failing tests
This commit is contained in:
parent
a792adec39
commit
7bc4f06b6e
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in New Issue