haikuwebkit/LayoutTests/js/arguments-iterator.html

11 lines
256 B
HTML
Raw Permalink Normal View History

Support iteration of the Arguments object https://bugs.webkit.org/show_bug.cgi?id=123835 Reviewed by Mark Lam. Source/JavaScriptCore: Add an ArgumentsIterator object, and associated classes so that we can support iteration of the arguments object. This is a largely mechanical patch. The only gnarliness is in the logic to avoid reifying the Arguments object in for(... of arguments) scenarios. * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitEnumeration): * runtime/Arguments.cpp: (JSC::Arguments::getOwnPropertySlot): (JSC::argumentsFuncIterator): * runtime/Arguments.h: * runtime/ArgumentsIteratorConstructor.cpp: Added. (JSC::ArgumentsIteratorConstructor::finishCreation): * runtime/ArgumentsIteratorConstructor.h: Added. (JSC::ArgumentsIteratorConstructor::create): (JSC::ArgumentsIteratorConstructor::createStructure): (JSC::ArgumentsIteratorConstructor::ArgumentsIteratorConstructor): * runtime/ArgumentsIteratorPrototype.cpp: Added. (JSC::ArgumentsIteratorPrototype::finishCreation): (JSC::argumentsIteratorPrototypeFuncIterator): (JSC::argumentsIteratorPrototypeFuncNext): * runtime/ArgumentsIteratorPrototype.h: Added. (JSC::ArgumentsIteratorPrototype::create): (JSC::ArgumentsIteratorPrototype::createStructure): (JSC::ArgumentsIteratorPrototype::ArgumentsIteratorPrototype): * runtime/CommonIdentifiers.h: * runtime/JSArgumentsIterator.cpp: Added. (JSC::JSArgumentsIterator::finishCreation): * runtime/JSArgumentsIterator.h: Added. (JSC::JSArgumentsIterator::createStructure): (JSC::JSArgumentsIterator::create): (JSC::JSArgumentsIterator::next): (JSC::JSArgumentsIterator::JSArgumentsIterator): * runtime/JSArrayIterator.cpp: (JSC::createIteratorResult): * runtime/JSGlobalObject.cpp: * runtime/JSGlobalObject.h: LayoutTests: Add test cases * js/arguments-iterator-expected.txt: Added. * js/arguments-iterator.html: Added. * js/script-tests/arguments-iterator.js: Added. (shouldThrow.test): (testAlias): (testStrict): (testReifiedArguments): (testOverwrittenArguments): (testNullArguments): (testNonArrayLikeArguments): Canonical link: https://commits.webkit.org/142111@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158793 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-11-06 22:37:46 +00:00
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
</head>
<body>
<script src="script-tests/arguments-iterator.js"></script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>