message = $ CYFalse();
driver.script_ = $ CYScript($ CYExpress($C4(ParseExpression(pool,
- " function(value, prefix, word, message) {\n"
- " var object = value;\n"
+ " function(object, prefix, word, message) {\n"
" var names = [];\n"
" var before = prefix.length;\n"
" prefix += word;\n"
" names.push(name);\n"
" } else do {\n"
" if (object.hasOwnProperty(\"cy$complete\"))\n"
- " names = names.concat(object.cy$complete.call(value, prefix, message));\n"
+ " names = names.concat(object.cy$complete(prefix, message));\n"
" try {\n"
" var local = Object.getOwnPropertyNames(object);\n"
" } catch (e) {\n"
if (string == NULL)
CYThrow("string was actually %s", typeid(*value->value_).name());
- CYUTF8String completion;
- if (string->size_ != 0)
- completion = {string->value_, string->size_};
- else if (driver.mode_ == CYDriver::AutoMessage)
- completion = "]";
- else
- continue;
-
+ CYUTF8String completion(string->value_, string->size_);
+ _assert(completion.size >= begin.size());
completion.data += begin.size();
completion.size -= begin.size();
+ if (completion.size == 0 && driver.mode_ == CYDriver::AutoMessage)
+ completion = "]";
+
if (CYStartsWith(completion, "$cy"))
continue;
completions.push_back(completion);