Changeset 201725 in webkit
- Timestamp:
- Jun 6, 2016 1:33:39 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r201724 r201725 1 2016-06-06 Skachkov Oleksandr <gskachkov@gmail.com> 2 3 [ESNext] Support trailing commas in function param lists 4 https://bugs.webkit.org/show_bug.cgi?id=158020 5 6 Reviewed by Keith Miller. 7 8 * js/parser-syntax-check-expected.txt: 9 * js/script-tests/parser-syntax-check.js: 10 * sputnik/Conformance/13_Function_Definition/S13_A5.html: 11 1 12 2016-06-06 George Ruan <gruan@apple.com> 2 13 -
trunk/LayoutTests/js/parser-syntax-check-expected.txt
r201566 r201725 138 138 PASS Invalid: "a(5," 139 139 PASS Invalid: "function f() { a(5, }" 140 PASS Invalid: "a(5,)"141 PASS Invalid:"function f() { a(5,) }"140 PASS Valid: "a(5,)" with ReferenceError 141 PASS Valid: "function f() { a(5,) }" 142 142 PASS Invalid: "a(5,6" 143 143 PASS Invalid: "function f() { a(5,6 }" … … 173 173 PASS Invalid: "function f(a b) {}" 174 174 PASS Invalid: "function f() { function f(a b) {} }" 175 PASS Invalid:"function f(a,) {}"176 PASS Invalid:"function f() { function f(a,) {} }"175 PASS Valid: "function f(a,) {}" 176 PASS Valid: "function f() { function f(a,) {} }" 177 177 PASS Invalid: "function f(a," 178 178 PASS Invalid: "function f() { function f(a, }" -
trunk/LayoutTests/js/script-tests/parser-syntax-check.js
r201566 r201725 148 148 invalid("a(5"); 149 149 invalid("a(5,"); 150 invalid("a(5,)");150 valid("a(5,)"); 151 151 invalid("a(5,6"); 152 152 valid ("a(b[7], c <d> e.l, new a() > b)"); … … 168 168 invalid("function () {}"); 169 169 invalid("function f(a b) {}"); 170 invalid("function f(a,) {}");170 valid("function f(a,) {}"); 171 171 invalid("function f(a,"); 172 172 invalid("function f(a, 1) {}"); -
trunk/LayoutTests/sputnik/Conformance/13_Function_Definition/S13_A5.html
r201566 r201725 101 101 //CHECK#3 102 102 try{ 103 eval("function __func(arg1, arg2, arg3, ){return arguments.length;}");104 testFailed('#3: eval("function __func(arg1, arg2, arg3, ){return arguments.length;}") lead to throwing exception')103 eval("function __func(arg1, arg2, arg3,,){return arguments.length;}"); 104 testFailed('#3: eval("function __func(arg1, arg2, arg3,,){return arguments.length;}") lead to throwing exception') 105 105 } catch(e){ 106 106 if(!(e instanceof SyntaxError)){ 107 testFailed('#3.1: eval("function __func(arg1, arg2, arg3, ){return arguments.length;}") lead to throwing exception of SyntaxError. Actual: exception is '+e);107 testFailed('#3.1: eval("function __func(arg1, arg2, arg3,,){return arguments.length;}") lead to throwing exception of SyntaxError. Actual: exception is '+e); 108 108 } 109 109 } -
trunk/Source/JavaScriptCore/ChangeLog
r201719 r201725 1 2016-06-06 Skachkov Oleksandr <gskachkov@gmail.com> 2 [ESNext] Trailing commas in function parameters. 3 https://bugs.webkit.org/show_bug.cgi?id=158020 4 5 Reviewed by Keith Miller. 6 7 ESNext allow to add trailing commas in function parameters and function arguments. 8 Link to spec - https://jeffmo.github.io/es-trailing-function-commas 9 Example of using - (function (a, b,) { return a + b; })(1,2,); 10 11 * parser/Parser.cpp: 12 (JSC::Parser<LexerType>::parseFormalParameters): 13 (JSC::Parser<LexerType>::parseArguments): 14 * tests/stress/trailing-comma-in-function-paramters.js: Added. 15 1 16 2016-06-05 Gavin & Ellie Barraclough <barraclough@apple.com> 2 17 -
trunk/Source/JavaScriptCore/parser/Parser.cpp
r201624 r201725 1747 1747 TreeExpression defaultValue = 0; 1748 1748 1749 if (UNLIKELY(match(CLOSEPAREN))) 1750 break; 1751 1749 1752 if (match(DOTDOTDOT)) { 1750 1753 next(); … … 3827 3830 next(TreeBuilder::DontBuildStrings); 3828 3831 3832 if (UNLIKELY(match(CLOSEPAREN))) 3833 break; 3834 3829 3835 TreeExpression arg = parseArgument(context, argType); 3830 3836 propagateError();
Note: See TracChangeset
for help on using the changeset viewer.