mirror of https://gitee.com/bigwinds/arangodb
work around unexcepted start/end values from V8
This commit is contained in:
parent
2fdaca29df
commit
b2c04f6165
|
@ -43,7 +43,7 @@ static Completer* COMPLETER = nullptr;
|
||||||
|
|
||||||
static void LinenoiseCompletionGenerator(char const* text,
|
static void LinenoiseCompletionGenerator(char const* text,
|
||||||
linenoiseCompletions* lc) {
|
linenoiseCompletions* lc) {
|
||||||
if (COMPLETER) {
|
if (COMPLETER && text != nullptr) {
|
||||||
std::vector<std::string> alternatives = COMPLETER->alternatives(text);
|
std::vector<std::string> alternatives = COMPLETER->alternatives(text);
|
||||||
ShellBase::sortAlternatives(alternatives);
|
ShellBase::sortAlternatives(alternatives);
|
||||||
|
|
||||||
|
|
|
@ -3925,7 +3925,14 @@ std::string TRI_StringifyV8Exception(v8::Isolate* isolate,
|
||||||
l = "";
|
l = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
l += std::string((size_t)(end - start + 1), '^');
|
// in fact, we observed start being greater than end sometimes...
|
||||||
|
// this does not make sense and seems to be a bug in V8, but it happens
|
||||||
|
// so we need to work around this
|
||||||
|
if (end >= start) {
|
||||||
|
l += std::string((size_t)(end - start + 1), '^');
|
||||||
|
} else {
|
||||||
|
l = "^";
|
||||||
|
}
|
||||||
|
|
||||||
result += "!" + l + "\n";
|
result += "!" + l + "\n";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue