Changeset 201488 in webkit
- Timestamp:
- May 28, 2016, 11:26:41 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 6 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/js/parser-syntax-check-expected.txt (modified) (2 diffs)
-
LayoutTests/js/script-tests/parser-syntax-check.js (modified) (2 diffs)
-
LayoutTests/sputnik/Conformance/13_Function_Definition/S13_A5.html (modified) (1 diff)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/parser/Parser.cpp (modified) (2 diffs)
-
Source/JavaScriptCore/tests/stress/trailing-comma-in-function-paramters.js (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r201476 r201488 1 2016-05-25 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-05-27 Zalan Bujtas <zalan@apple.com> 2 13 -
trunk/LayoutTests/js/parser-syntax-check-expected.txt
r199352 r201488 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
r199352 r201488 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
r156785 r201488 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
r201487 r201488 1 2016-05-28 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-05-28 Yusuke Suzuki <utatane.tea@gmail.com> 2 17 -
trunk/Source/JavaScriptCore/parser/Parser.cpp
r201481 r201488 1838 1838 TreeExpression defaultValue = 0; 1839 1839 1840 if (match(CLOSEPAREN)) 1841 break; 1842 1840 1843 if (match(DOTDOTDOT)) { 1841 1844 next(); … … 4064 4067 next(TreeBuilder::DontBuildStrings); 4065 4068 4069 if (match(CLOSEPAREN)) 4070 break; 4071 4066 4072 TreeExpression arg = parseArgument(context, argType); 4067 4073 propagateError();
Note:
See TracChangeset
for help on using the changeset viewer.