Issue 38: need more "const correctness"
http://code.google.com/p/v8/issues/detail?id=38
New issue report by pete.gontier:
In general, it would be nice if the API had more "const correctness". As an
example, consider Value::IsString. Because it is not declared 'const', it
causes contortions in client code, some of which are slower and less safe
than they might be. As an illustration, consider:
static void write (Local <Value> & value)
// 'value' cannot be declared const
{
if (value->IsString ( ))
{
// blah blah
}
}
static Handle <Value> writeCallback (const Arguments & arguments)
{
uint32_t argumentCount (arguments.Length ( ));
if (argumentCount)
{
uint32_t argumentIndex (0);
do
{
// necessary to create a temporary copy
// in case it's modified, even though we
// know no one will ever modify it
Local <Value> value (arguments [argumentIndex]);
write (value);
}
while (++argumentIndex < argumentCount);
}
return Undefined ( );
}
Retroactively adding const-correctness sometimes has far-reaching
implications, but most if not all changes are low-risk monkey-work.
Issue attributes:
Status: New
Owner: ----
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---