Source/JavaScriptCore:
authorgskachkov@gmail.com <gskachkov@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Jun 2016 20:33:39 +0000 (20:33 +0000)
committergskachkov@gmail.com <gskachkov@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Jun 2016 20:33:39 +0000 (20:33 +0000)
commita1d254dea6a9cade66003bd9d1175c70169b9335
tree1a5c8846c6020e667572bd723098f63a1caba1e4
parent9b07f8ea91febc8567aae656b3f32953a17fc796
Source/JavaScriptCore:
[ESNext] Trailing commas in function parameters.
https://bugs.webkit.org/show_bug.cgi?id=158020

Reviewed by Keith Miller.

ESNext allow to add trailing commas in function parameters and function arguments.
Link to spec - https://jeffmo.github.io/es-trailing-function-commas
Example of using - (function (a, b,) { return a + b; })(1,2,);

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseFormalParameters):
(JSC::Parser<LexerType>::parseArguments):
* tests/stress/trailing-comma-in-function-paramters.js: Added.

LayoutTests:
[ESNext] Support trailing commas in function param lists
https://bugs.webkit.org/show_bug.cgi?id=158020

Reviewed by Keith Miller.

* js/parser-syntax-check-expected.txt:
* js/script-tests/parser-syntax-check.js:
* sputnik/Conformance/13_Function_Definition/S13_A5.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201725 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/js/parser-syntax-check-expected.txt
LayoutTests/js/script-tests/parser-syntax-check.js
LayoutTests/sputnik/Conformance/13_Function_Definition/S13_A5.html
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/parser/Parser.cpp
Source/JavaScriptCore/tests/stress/trailing-comma-in-function-paramters.js [new file with mode: 0644]