haikuwebkit/LayoutTests/js/basic-for-of-expected.txt

97 lines
2.0 KiB
Plaintext
Raw Permalink Normal View History

Support for-of syntax https://bugs.webkit.org/show_bug.cgi?id=122339 Reviewed by Geoffrey Garen. Source/JavaScriptCore: Add support for for-of syntax to JSC. As part of doing this I had to make us support unique empty strings as identifiers. In a follow on patch i'm going to remove the distinction entirely as it's purely a complicating separation. Otherwise the logic here is fairly self-explanatory. * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::addConstant): (JSC::BytecodeGenerator::emitCall): * bytecompiler/BytecodeGenerator.h: * bytecompiler/NodesCodegen.cpp: (JSC::CallArguments::CallArguments): (JSC::ForOfNode::emitBytecode): * jit/JITOperations.cpp: * parser/ASTBuilder.h: (JSC::ASTBuilder::createForOfLoop): * parser/NodeConstructors.h: (JSC::EnumerationNode::EnumerationNode): (JSC::ForInNode::ForInNode): (JSC::ForOfNode::ForOfNode): * parser/Nodes.h: * parser/Parser.cpp: (JSC::::parseVarDeclarationList): (JSC::::parseForStatement): * parser/Parser.h: (JSC::Parser::isofToken): * parser/SyntaxChecker.h: (JSC::SyntaxChecker::createForOfLoop): * runtime/ArrayIteratorPrototype.cpp: (JSC::ArrayIteratorPrototype::finishCreation): (JSC::arrayIteratorPrototypeIterate): * runtime/ArrayPrototype.cpp: (JSC::ArrayPrototype::create): (JSC::ArrayPrototype::finishCreation): * runtime/ArrayPrototype.h: * runtime/CommonIdentifiers.cpp: (JSC::CommonIdentifiers::CommonIdentifiers): * runtime/CommonIdentifiers.h: * runtime/Identifier.h: (JSC::Identifier::from): * runtime/JSCJSValue.cpp: (JSC::JSValue::dumpInContext): * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::reset): * runtime/JSObject.cpp: (JSC::JSObject::putDirectNativeFunction): * runtime/PrivateName.h: (JSC::PrivateName::PrivateName): * runtime/PropertyName.h: (JSC::PropertyName::PropertyName): Source/WTF: Update assertions and add a helper function to StringImpl to save repeated unique or identifier calls. * wtf/text/StringImpl.h: (WTF::StringImpl::isIdentifierOrUnique): (WTF::StringImpl::setIsIdentifier): (WTF::StringImpl::setIsAtomic): LayoutTests: Add test cases for the one type that supports for-of so far * js/basic-for-of-expected.txt: Added. * js/basic-for-of.html: Added. * js/regress/for-of-iterate-array-entries.html: Added. * js/regress/for-of-iterate-array-keys.html: Added. * js/regress/for-of-iterate-array-values.html: Added. * js/regress/script-tests/for-of-iterate-array-entries.js: Added. (foo): * js/regress/script-tests/for-of-iterate-array-keys.js: Added. (foo): * js/regress/script-tests/for-of-iterate-array-values.js: Added. (foo): Canonical link: https://commits.webkit.org/140387@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156910 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-04 20:35:24 +00:00
This test checks the behavior of the for-of construct.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS value is testArray[0]
PASS value is testArray[1]
PASS value is testArray[2]
PASS value is testArray[3]
PASS value is testArray[4]
PASS value is testArray[5]
PASS testArray.length is 6
PASS key is 0
PASS key is 1
PASS key is 2
PASS key is 3
PASS key is 4
PASS key is 5
PASS testArray.length is 6
PASS this.prop1 is 0
PASS this.prop1 is 1
PASS this.prop1 is 2
PASS this.prop1 is 3
PASS this.prop1 is 4
PASS this.prop1 is 5
PASS testArray.length is 6
PASS this[prop2] is 0
PASS this[prop2] is 1
PASS this[prop2] is 2
PASS this[prop2] is 3
PASS this[prop2] is 4
PASS this[prop2] is 5
PASS testArray.length is 6
PASS key is 0
PASS value is 1
PASS key is 1
PASS value is 2
PASS key is 2
PASS value is 3
PASS key is 3
PASS value is 4
PASS key is 4
PASS value is 5
PASS key is 5
PASS value is 6
PASS testArray.length is 6
PASS value is testArray[key]
PASS key is i
PASS value is testArray[key]
PASS key is i
PASS value is testArray[key]
PASS key is i
PASS value is testArray[key]
PASS key is i
PASS value is testArray[key]
PASS key is i
PASS value is testArray[key]
PASS key is i
PASS value is testArray[key]
PASS key is i
PASS value is testArray[key]
PASS key is i
PASS value is testArray[key]
PASS key is i
PASS testArray.length is 9
PASS value is testArray[key]
PASS key is i
PASS value is testArray[key]
PASS key is i
PASS value is testArray[key]
PASS key is i
PASS value is testArray[key]
PASS key is i
PASS value is testArray[key]
PASS key is i
PASS value is testArray[key]
PASS key is i
PASS value is testArray[key]
PASS key is i
PASS value is testArray[key]
PASS key is i
PASS value is testArray[key]
PASS key is i
PASS value is testArray[key]
PASS key is i
PASS value is testArray[key]
PASS key is i
PASS value is testArray[key]
PASS key is i
PASS value is testArray[key]
PASS key is i
PASS testArray.length is 13
Support for-of syntax https://bugs.webkit.org/show_bug.cgi?id=122339 Reviewed by Geoffrey Garen. Source/JavaScriptCore: Add support for for-of syntax to JSC. As part of doing this I had to make us support unique empty strings as identifiers. In a follow on patch i'm going to remove the distinction entirely as it's purely a complicating separation. Otherwise the logic here is fairly self-explanatory. * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::addConstant): (JSC::BytecodeGenerator::emitCall): * bytecompiler/BytecodeGenerator.h: * bytecompiler/NodesCodegen.cpp: (JSC::CallArguments::CallArguments): (JSC::ForOfNode::emitBytecode): * jit/JITOperations.cpp: * parser/ASTBuilder.h: (JSC::ASTBuilder::createForOfLoop): * parser/NodeConstructors.h: (JSC::EnumerationNode::EnumerationNode): (JSC::ForInNode::ForInNode): (JSC::ForOfNode::ForOfNode): * parser/Nodes.h: * parser/Parser.cpp: (JSC::::parseVarDeclarationList): (JSC::::parseForStatement): * parser/Parser.h: (JSC::Parser::isofToken): * parser/SyntaxChecker.h: (JSC::SyntaxChecker::createForOfLoop): * runtime/ArrayIteratorPrototype.cpp: (JSC::ArrayIteratorPrototype::finishCreation): (JSC::arrayIteratorPrototypeIterate): * runtime/ArrayPrototype.cpp: (JSC::ArrayPrototype::create): (JSC::ArrayPrototype::finishCreation): * runtime/ArrayPrototype.h: * runtime/CommonIdentifiers.cpp: (JSC::CommonIdentifiers::CommonIdentifiers): * runtime/CommonIdentifiers.h: * runtime/Identifier.h: (JSC::Identifier::from): * runtime/JSCJSValue.cpp: (JSC::JSValue::dumpInContext): * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::reset): * runtime/JSObject.cpp: (JSC::JSObject::putDirectNativeFunction): * runtime/PrivateName.h: (JSC::PrivateName::PrivateName): * runtime/PropertyName.h: (JSC::PropertyName::PropertyName): Source/WTF: Update assertions and add a helper function to StringImpl to save repeated unique or identifier calls. * wtf/text/StringImpl.h: (WTF::StringImpl::isIdentifierOrUnique): (WTF::StringImpl::setIsIdentifier): (WTF::StringImpl::setIsAtomic): LayoutTests: Add test cases for the one type that supports for-of so far * js/basic-for-of-expected.txt: Added. * js/basic-for-of.html: Added. * js/regress/for-of-iterate-array-entries.html: Added. * js/regress/for-of-iterate-array-keys.html: Added. * js/regress/for-of-iterate-array-values.html: Added. * js/regress/script-tests/for-of-iterate-array-entries.js: Added. (foo): * js/regress/script-tests/for-of-iterate-array-keys.js: Added. (foo): * js/regress/script-tests/for-of-iterate-array-values.js: Added. (foo): Canonical link: https://commits.webkit.org/140387@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156910 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-04 20:35:24 +00:00
PASS successfullyParsed is true
TEST COMPLETE