Skip to content
  • ch.dumez@sisa.samsung.com's avatar
    Global constructors should be configurable and not enumerable · 0051b742
    ch.dumez@sisa.samsung.com authored
    https://bugs.webkit.org/show_bug.cgi?id=110573
    
    Reviewed by Geoffrey Garen.
    
    Source/JavaScriptCore:
    
    Update JSObject::deleteProperty() so that mark to set the property
    value to undefined if it is in static hashtable of properties. The
    previous code was not doing anything in this case and this meant
    we could not remove builtin DOMWindow properties such as
    "ProgressEvent" even if marked as Deletable.
    
    * runtime/JSObject.cpp:
    (JSC::JSObject::deleteProperty):
    * runtime/Lookup.h:
    (JSC):
    (JSC::putEntry):
    (JSC::lookupPut):
    
    Source/WebCore:
    
    Update JSC Code generator so that global constructors now have the following
    attributes:
    { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }
    instead of previously:
    { [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: false }
    
    The new behavior is according to the Web IDL specification (section 4.4):
    http://dev.w3.org/cvsweb/~checkout~/2006/webapi/WebIDL/Overview.html?rev=1.617;content-type=text%2Fhtml#es-interfaces
    
    This also matches the behavior of Firefox.
    
    Tests: fast/js/global-constructors-attributes.html
           fast/js/global-constructors-deletable.html
    
    * bindings/scripts/CodeGeneratorJS.pm:
    (GenerateAttributesHashTable):
    
    LayoutTests:
    
    Add new tests to make sure that the global constructors have the
    right attributes and to check that they are 'Deletable'.
    
    * canvas/philip/tests/type.delete-expected.txt: Removed.
    * canvas/philip/tests/type.delete.html: Removed. It was checking that global constructor
    could NOT be deleted, which is no longer according to the Web IDL specification.
    * fast/dom/constructed-objects-prototypes-expected.txt:
    * fast/dom/script-tests/constructed-objects-prototypes.js: Update test to hardcode a few
    global constructors as they are no longer enumerable.
    * fast/js/getOwnPropertyDescriptor-expected.txt:
    * fast/js/global-constructors.html: Removed. It was relying on the global constructors
    to be 'Enumerable', which is not to the latest Web IDL specification.
    * fast/js/global-constructors-attributes-expected.txt: Added.
    * fast/js/global-constructors-attributes.html: Added.
    * fast/js/global-constructors-deletable-expected.txt: Added.
    * fast/js/global-constructors-deletable.html: Added.
    * fast/js/global-constructors-expected.txt: Removed.
    * fast/js/resources/getOwnPropertyDescriptor.js:
    * fast/js/script-tests/global-constructors-attributes.js: Added.
    * fast/js/script-tests/global-constructors-deletable.js: Added.
    * fast/js/script-tests/global-constructors.js: Removed.
    * platform/efl/fast/dom/constructed-objects-prototypes-expected.txt: Removed.
    * platform/efl/fast/js/global-constructors-expected.txt: Removed.
    * platform/gtk/fast/dom/constructed-objects-prototypes-expected.txt: Removed.
    * platform/gtk/fast/js/global-constructors-expected.txt: Removed.
    * platform/mac/fast/js/global-constructors-expected.txt: Removed.
    * platform/qt/fast/dom/constructed-objects-prototypes-expected.txt: Removed.
    * platform/qt/fast/js/global-constructors-expected.txt: Removed.
    * platform/win/fast/dom/constructed-objects-prototypes-expected.txt: Removed.
    * platform/win/fast/js/global-constructors-expected.txt: Removed.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149001 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    0051b742