haikuwebkit/LayoutTests/js/basic-spread.html

11 lines
250 B
HTML
Raw Permalink Normal View History

Source/JavaScriptCore: Implement ES6 spread operator https://bugs.webkit.org/show_bug.cgi?id=122911 Reviewed by Michael Saboff. Implement the ES6 spread operator This has a little bit of refactoring to move the enumeration logic out ForOfNode and into BytecodeGenerator, and then adds the logic to make it nicely callback driven. The rest of the logic is just the addition of the SpreadExpressionNode, the parsing, and actually handling the spread. * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitNewArray): (JSC::BytecodeGenerator::emitCall): (JSC::BytecodeGenerator::emitEnumeration): * bytecompiler/BytecodeGenerator.h: * bytecompiler/NodesCodegen.cpp: (JSC::ArrayNode::emitBytecode): (JSC::ForOfNode::emitBytecode): (JSC::SpreadExpressionNode::emitBytecode): * parser/ASTBuilder.h: (JSC::ASTBuilder::createSpreadExpression): * parser/Lexer.cpp: (JSC::::lex): * parser/NodeConstructors.h: (JSC::SpreadExpressionNode::SpreadExpressionNode): * parser/Nodes.h: (JSC::ExpressionNode::isSpreadExpression): (JSC::SpreadExpressionNode::expression): * parser/Parser.cpp: (JSC::::parseArrayLiteral): (JSC::::parseArguments): (JSC::::parseMemberExpression): * parser/Parser.h: (JSC::Parser::getTokenName): (JSC::Parser::updateErrorMessageSpecialCase): * parser/ParserTokens.h: * parser/SyntaxChecker.h: (JSC::SyntaxChecker::createSpreadExpression): LayoutTests: Implement spread https://bugs.webkit.org/show_bug.cgi?id=122911 Reviewed by Michael Saboff. Add testcases * js/basic-spread-expected.txt: Added. * js/basic-spread.html: Added. * js/parser-syntax-check-expected.txt: * js/script-tests/basic-spread.js: Added. (f): (o.f.o.f.o.f.o.f.h.eval.o.h.o.h.o.h.o.h.g): * js/script-tests/parser-syntax-check.js: Canonical link: https://commits.webkit.org/141007@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157545 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-17 01:02:34 +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/basic-spread.js"></script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>