X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/81345200c95645a1b0d2635520f96ad55dfde63f..HEAD:/runtime/PropertyDescriptor.cpp diff --git a/runtime/PropertyDescriptor.cpp b/runtime/PropertyDescriptor.cpp index 450920c..5722e88 100644 --- a/runtime/PropertyDescriptor.cpp +++ b/runtime/PropertyDescriptor.cpp @@ -106,8 +106,8 @@ void PropertyDescriptor::setDescriptor(JSValue value, unsigned attributes) m_attributes &= ~ReadOnly; // FIXME: we should be able to ASSERT this! GetterSetter* accessor = asGetterSetter(value); - m_getter = accessor->getter() ? accessor->getter() : jsUndefined(); - m_setter = accessor->setter() ? accessor->setter() : jsUndefined(); + m_getter = !accessor->isGetterNull() ? accessor->getter() : jsUndefined(); + m_setter = !accessor->isSetterNull() ? accessor->setter() : jsUndefined(); m_seenAttributes = EnumerablePresent | ConfigurablePresent; } else { m_value = value; @@ -131,8 +131,8 @@ void PropertyDescriptor::setAccessorDescriptor(GetterSetter* accessor, unsigned attributes &= ~ReadOnly; // FIXME: we should be able to ASSERT this! m_attributes = attributes; - m_getter = accessor->getter() ? accessor->getter() : jsUndefined(); - m_setter = accessor->setter() ? accessor->setter() : jsUndefined(); + m_getter = !accessor->isGetterNull() ? accessor->getter() : jsUndefined(); + m_setter = !accessor->isSetterNull() ? accessor->setter() : jsUndefined(); m_seenAttributes = EnumerablePresent | ConfigurablePresent; } @@ -186,8 +186,10 @@ bool sameValue(ExecState* exec, JSValue a, JSValue b) return false; double x = a.asNumber(); double y = b.asNumber(); - if (std::isnan(x)) - return std::isnan(y); + bool xIsNaN = std::isnan(x); + bool yIsNaN = std::isnan(y); + if (xIsNaN || yIsNaN) + return xIsNaN && yIsNaN; return bitwise_cast(x) == bitwise_cast(y); }