mirror of https://gitee.com/bigwinds/arangodb
fixed failing tests
This commit is contained in:
parent
a792adec39
commit
7bc4f06b6e
|
@ -2459,9 +2459,11 @@ 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 argument is supplied, we'll return a list - otherwise we simply return the first doc
|
||||||
if (argv.Length() == 1) {
|
if (argv.Length() == 1) {
|
||||||
|
if (! argv[0]->IsUndefined()) {
|
||||||
count = TRI_ObjectToInt64(argv[0]);
|
count = TRI_ObjectToInt64(argv[0]);
|
||||||
returnList = true;
|
returnList = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (count < 1) {
|
if (count < 1) {
|
||||||
TRI_V8_EXCEPTION_PARAMETER(scope, "invalid value for <count>");
|
TRI_V8_EXCEPTION_PARAMETER(scope, "invalid value for <count>");
|
||||||
|
@ -2714,9 +2716,11 @@ 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 argument is supplied, we'll return a list - otherwise we simply return the last doc
|
||||||
if (argv.Length() == 1) {
|
if (argv.Length() == 1) {
|
||||||
|
if (! argv[0]->IsUndefined()) {
|
||||||
count = TRI_ObjectToInt64(argv[0]);
|
count = TRI_ObjectToInt64(argv[0]);
|
||||||
returnList = true;
|
returnList = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (count < 1) {
|
if (count < 1) {
|
||||||
TRI_V8_EXCEPTION_PARAMETER(scope, "invalid value for <count>");
|
TRI_V8_EXCEPTION_PARAMETER(scope, "invalid value for <count>");
|
||||||
|
|
|
@ -324,11 +324,12 @@ ArangoCollection.prototype.first = function (count) {
|
||||||
var body = JSON.parse(results[i].body);
|
var body = JSON.parse(results[i].body);
|
||||||
return body.result || null;
|
return body.result || null;
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return this.FIRST(count);
|
return this.FIRST(count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -336,7 +337,7 @@ ArangoCollection.prototype.first = function (count) {
|
||||||
///
|
///
|
||||||
/// @FUN{@FA{collection}.last(@FA{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.
|
/// order of document insertion/update time.
|
||||||
///
|
///
|
||||||
/// If called with the @FA{count} argument, the result is a list of up to
|
/// If called with the @FA{count} argument, the result is a list of up to
|
||||||
|
@ -406,6 +407,8 @@ ArangoCollection.prototype.last = function (count) {
|
||||||
else {
|
else {
|
||||||
return this.LAST(count);
|
return this.LAST(count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue