diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
commit | 32761a6cee1d0dee366b885b7b9c777e67885688 (patch) | |
tree | d6bec92bebfb216f4126356e55518842c2f476a1 /Source/JavaScriptCore/runtime/PropertyDescriptor.cpp | |
parent | a4e969f4965059196ca948db781e52f7cfebf19e (diff) | |
download | WebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz |
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/JavaScriptCore/runtime/PropertyDescriptor.cpp')
-rw-r--r-- | Source/JavaScriptCore/runtime/PropertyDescriptor.cpp | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/Source/JavaScriptCore/runtime/PropertyDescriptor.cpp b/Source/JavaScriptCore/runtime/PropertyDescriptor.cpp index 8e5681bc4..1dd35605c 100644 --- a/Source/JavaScriptCore/runtime/PropertyDescriptor.cpp +++ b/Source/JavaScriptCore/runtime/PropertyDescriptor.cpp @@ -30,7 +30,7 @@ #include "GetterSetter.h" #include "JSObject.h" -#include "JSCInlines.h" +#include "Operations.h" namespace JSC { unsigned PropertyDescriptor::defaultAttributes = DontDelete | DontEnum | ReadOnly; @@ -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->isGetterNull() ? accessor->getter() : jsUndefined(); - m_setter = !accessor->isSetterNull() ? accessor->setter() : jsUndefined(); + m_getter = accessor->getter() ? accessor->getter() : jsUndefined(); + m_setter = accessor->setter() ? accessor->setter() : jsUndefined(); m_seenAttributes = EnumerablePresent | ConfigurablePresent; } else { m_value = value; @@ -115,24 +115,14 @@ void PropertyDescriptor::setDescriptor(JSValue value, unsigned attributes) } } -void PropertyDescriptor::setCustomDescriptor(unsigned attributes) -{ - m_attributes = attributes | Accessor | CustomAccessor; - m_attributes &= ~ReadOnly; - m_seenAttributes = EnumerablePresent | ConfigurablePresent; - setGetter(jsUndefined()); - setSetter(jsUndefined()); - m_value = JSValue(); -} - void PropertyDescriptor::setAccessorDescriptor(GetterSetter* accessor, unsigned attributes) { ASSERT(attributes & Accessor); attributes &= ~ReadOnly; // FIXME: we should be able to ASSERT this! m_attributes = attributes; - m_getter = !accessor->isGetterNull() ? accessor->getter() : jsUndefined(); - m_setter = !accessor->isSetterNull() ? accessor->setter() : jsUndefined(); + m_getter = accessor->getter() ? accessor->getter() : jsUndefined(); + m_setter = accessor->setter() ? accessor->setter() : jsUndefined(); m_seenAttributes = EnumerablePresent | ConfigurablePresent; } @@ -186,10 +176,8 @@ bool sameValue(ExecState* exec, JSValue a, JSValue b) return false; double x = a.asNumber(); double y = b.asNumber(); - bool xIsNaN = std::isnan(x); - bool yIsNaN = std::isnan(y); - if (xIsNaN || yIsNaN) - return xIsNaN && yIsNaN; + if (std::isnan(x)) + return std::isnan(y); return bitwise_cast<uint64_t>(x) == bitwise_cast<uint64_t>(y); } @@ -232,7 +220,7 @@ unsigned PropertyDescriptor::attributesOverridingCurrent(const PropertyDescripto overrideMask |= DontDelete; if (isAccessorDescriptor()) overrideMask |= Accessor; - return (m_attributes & overrideMask) | (currentAttributes & ~overrideMask & ~CustomAccessor); + return (m_attributes & overrideMask) | (currentAttributes & ~overrideMask); } } |