Bug 975042 - Remove the special COW support for Date. r=peterv
As soon as Date is on Xrays, this stuff won't work anyway. Henceforth, content access to chrome Date objects is forbidden, and APIs should use something like |new contentWindow.Date()| for any Date object they wish to expose to content.
This commit is contained in:
@@ -3179,19 +3179,3 @@ 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user