TT strings: implementation questions
jimb at mozilla.com
Wed Jun 11 07:54:20 PDT 2008
"Michael Daumling" <mdaeumli at adobe.com> writes:
> 1) I am seeing this comment in StringObject.h:
> // unfortunately, memcmp isn't guaranteed to return the actual
> difference between the final bytes (as required
> // by localeCompare), only -1/0/1, and the MSVC implementation seems to
> do the latter.... Sigh
> Why does localeCompare() have this requirement? ECMA-262 does not
> mention it.
practice is to go well beyond what the spec requires to remain
compatible with existing implementations' behavior. My thinking is, a
new C compiler can choose a novel but compliant interpretation of the C
standard, and it's (mostly) okay because the first people to encounter
resultant changes in behavior are developers, who can do something about
browser by an end user.
So it seems to me the spec is useful for recognizing violations, but
compliance with the spec isn't a guarantee of good behavior. It only
works one way.
More information about the Tamarin-devel