Fix bogus ASSERT

When in synchronous mode, we might need to call canTakeNextToken (i.e., during
document.write).