Skip to content
  • oliver@apple.com's avatar
    Implement Set iterators · 96cafa31
    oliver@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=124129
    
    Reviewed by Antti Koivisto.
    
    Source/JavaScriptCore:
    
    Add Set iterator classes and implementations
    
    * JavaScriptCore.xcodeproj/project.pbxproj:
    * runtime/CommonIdentifiers.h:
    * runtime/JSGlobalObject.cpp:
    * runtime/JSGlobalObject.h:
    * runtime/JSSetIterator.cpp: Added.
    (JSC::JSSetIterator::finishCreation):
    (JSC::JSSetIterator::visitChildren):
    (JSC::JSSetIterator::createPair):
    * runtime/JSSetIterator.h: Added.
    (JSC::JSSetIterator::createStructure):
    (JSC::JSSetIterator::create):
    (JSC::JSSetIterator::next):
    (JSC::JSSetIterator::JSSetIterator):
    * runtime/SetIteratorConstructor.cpp: Added.
    (JSC::SetIteratorConstructor::finishCreation):
    * runtime/SetIteratorConstructor.h: Added.
    (JSC::SetIteratorConstructor::create):
    (JSC::SetIteratorConstructor::createStructure):
    (JSC::SetIteratorConstructor::SetIteratorConstructor):
    * runtime/SetIteratorPrototype.cpp: Added.
    (JSC::SetIteratorPrototype::finishCreation):
    (JSC::SetIteratorPrototypeFuncIterator):
    (JSC::SetIteratorPrototypeFuncNext):
    * runtime/SetIteratorPrototype.h: Added.
    (JSC::SetIteratorPrototype::create):
    (JSC::SetIteratorPrototype::createStructure):
    (JSC::SetIteratorPrototype::SetIteratorPrototype):
    * runtime/SetPrototype.cpp:
    (JSC::SetPrototype::finishCreation):
    (JSC::setProtoFuncValues):
    (JSC::setProtoFuncEntries):
    (JSC::setProtoFuncKeys):
    
    LayoutTests:
    
    Move Set tests to more sensible location and add iterator tests
    
    * js/basic-set-expected.txt: Renamed from LayoutTests/js/dom/basic-set-expected.txt.
    * js/basic-set.html: Renamed from LayoutTests/js/dom/basic-set.html.
    * js/script-tests/basic-set.js: Renamed from LayoutTests/js/dom/script-tests/basic-set.js.
    (set new):
    (otherString.string_appeared_here.set add):
    (try.set forEach):
    (set forEach):
    (set gc):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159031 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    96cafa31