Need to modify string BEFORE caching iterators.

This commit is contained in:
beard%netscape.com 2000-05-09 06:39:39 +00:00
parent ad2ad1e77c
commit eb9d678d61
2 changed files with 4 additions and 4 deletions

View File

@ -35,11 +35,11 @@ namespace JS = JavaScript;
JS::Reader::Reader(const String &source, const String &sourceLocation, uint32 initialLineNum):
source(source), sourceLocation(sourceLocation), initialLineNum(initialLineNum)
{
Reader::source += char16(uni::null); // ensure last character is always '\0'
const char16 *b = Reader::source.data();
begin = b;
p = b;
end = b + Reader::source.size();
Reader::source.append(uni::null); // ensure last character is always '\0'
end = b + Reader::source.size() - 1;
#ifdef DEBUG
recordString = 0;
#endif

View File

@ -35,11 +35,11 @@ namespace JS = JavaScript;
JS::Reader::Reader(const String &source, const String &sourceLocation, uint32 initialLineNum):
source(source), sourceLocation(sourceLocation), initialLineNum(initialLineNum)
{
Reader::source += char16(uni::null); // ensure last character is always '\0'
const char16 *b = Reader::source.data();
begin = b;
p = b;
end = b + Reader::source.size();
Reader::source.append(uni::null); // ensure last character is always '\0'
end = b + Reader::source.size() - 1;
#ifdef DEBUG
recordString = 0;
#endif