For now, some 8-bit version of static member function of StringImpl returns empty() which for now has only a 16-bit version. This will cause problems in the following scenario: RefPtr<StringImpl> s(StringImpl::create8("")); s.characters8(); // Assertion fails I thought of two solutions: 1. Add StringImpl::empty8() which is the 8-bit version of StringImpl::empty(); 2. Add StringImpl::is16Bit(). For empty strings, both is8Bit() and is16Bit() returns true. Change all ASSERT(!is8Bit()) to ASSERT(is16Bit()). I prefer the second way because all existing callers of empty() could remain unchanged.
I'd like to hold on this bug until we actually enable 8-bit buffers (i.e. when we remove the ASSERT_NOT_REACHED() in StringImpl::characters8().
The current StringImpl::empty() returns a 8-bit string.