Backed out changeset f787c0fa465e (bug 975042) for B2G ICS Emulator M7 Orange on a CLOSED TREE

This commit is contained in:
Carsten "Tomcat" Book
2014-03-21 08:48:40 +01:00
parent f2405dd593
commit 3250e93b36
4 changed files with 28 additions and 13 deletions

View File

@@ -3179,3 +3179,19 @@ static const NativeImpl sReadOnlyDateMethods[] = {
date_toString_impl,
date_valueOf_impl
};
JS_FRIEND_API(bool)
js::IsReadOnlyDateMethod(IsAcceptableThis test, NativeImpl method)
{
/* Avoid a linear search in the common case by checking the |this| test. */
if (test != IsDate)
return false;
/* Linear search, comparing function pointers. */
unsigned max = sizeof(sReadOnlyDateMethods) / sizeof(sReadOnlyDateMethods[0]);
for (unsigned i = 0; i < max; ++i) {
if (method == sReadOnlyDateMethods[i])
return true;
}
return false;
}