Changeset 206590 in webkit
- Timestamp:
- Sep 29, 2016, 11:03:23 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r206573 r206590 1 2016-09-29 Saam Barati <sbarati@apple.com> 2 3 We don't properly propagate non-simple-parameter-list when parsing a setter 4 https://bugs.webkit.org/show_bug.cgi?id=160483 5 6 Reviewed by Joseph Pecoraro. 7 8 * test262.yaml: 9 1 10 2016-09-28 Saam Barati <sbarati@apple.com> 2 11 -
trunk/JSTests/test262.yaml
r206353 r206590 66727 66727 cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict] 66728 66728 - path: test262/test/language/expressions/object/method-definition/setter-use-strict-with-non-simple-param.js 66729 cmd: runTest262 : fail, "SyntaxError", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []66729 cmd: runTest262 :normal, "SyntaxError", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [] 66730 66730 - path: test262/test/language/expressions/object/method-definition/setter-use-strict-with-non-simple-param.js 66731 cmd: runTest262 : fail, "SyntaxError", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]66731 cmd: runTest262 :normal, "SyntaxError", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict] 66732 66732 - path: test262/test/language/expressions/object/method-definition/use-strict-with-non-simple-param.js 66733 66733 cmd: runTest262 :normal, "SyntaxError", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [] -
trunk/LayoutTests/ChangeLog
r206581 r206590 1 2016-09-29 Saam Barati <sbarati@apple.com> 2 3 We don't properly propagate non-simple-parameter-list when parsing a setter 4 https://bugs.webkit.org/show_bug.cgi?id=160483 5 6 Reviewed by Joseph Pecoraro. 7 8 * js/parser-syntax-check-expected.txt: 9 * js/script-tests/parser-syntax-check.js: 10 1 11 2016-09-29 Nan Wang <n_wang@apple.com> 2 12 -
trunk/LayoutTests/js/parser-syntax-check-expected.txt
r204895 r206590 1040 1040 PASS Invalid: "({set [x (x){}})" 1041 1041 PASS Invalid: "function f() { ({set [x (x){}}) }" 1042 PASS Valid: "({set foo(x) { } })" 1043 PASS Valid: "function f() { ({set foo(x) { } }) }" 1044 PASS Valid: "({set foo(x) { 'use strict'; } })" 1045 PASS Valid: "function f() { ({set foo(x) { 'use strict'; } }) }" 1046 PASS Invalid: "({set foo(x = 20) { 'use strict'; } })" 1047 PASS Invalid: "function f() { ({set foo(x = 20) { 'use strict'; } }) }" 1048 PASS Invalid: "({set foo({x}) { 'use strict'; } })" 1049 PASS Invalid: "function f() { ({set foo({x}) { 'use strict'; } }) }" 1050 PASS Invalid: "({set foo([x]) { 'use strict'; } })" 1051 PASS Invalid: "function f() { ({set foo([x]) { 'use strict'; } }) }" 1052 PASS Invalid: "({set foo(...x) {} })" 1053 PASS Invalid: "function f() { ({set foo(...x) {} }) }" 1054 PASS Valid: "class Foo { set v(z) { } }" 1055 PASS Valid: "function f() { class Foo { set v(z) { } } }" 1056 PASS Valid: "class Foo { set v(z) { 'use strict'; } }" 1057 PASS Valid: "function f() { class Foo { set v(z) { 'use strict'; } } }" 1058 PASS Invalid: "class Foo { set v(z = 50) { 'use strict'; } }" 1059 PASS Invalid: "function f() { class Foo { set v(z = 50) { 'use strict'; } } }" 1060 PASS Invalid: "class Foo { set v({z}) { 'use strict'; } }" 1061 PASS Invalid: "function f() { class Foo { set v({z}) { 'use strict'; } } }" 1062 PASS Invalid: "class Foo { set v([z]) { 'use strict'; } }" 1063 PASS Invalid: "function f() { class Foo { set v([z]) { 'use strict'; } } }" 1064 PASS Invalid: "class Foo { set v(...z) { } }" 1065 PASS Invalid: "function f() { class Foo { set v(...z) { } } }" 1066 PASS Invalid: "class foo { set y([x, y, x]) { } }" 1067 PASS Invalid: "function f() { class foo { set y([x, y, x]) { } } }" 1068 PASS Invalid: "class foo { set y([x, y, {x}]) { } }" 1069 PASS Invalid: "function f() { class foo { set y([x, y, {x}]) { } } }" 1070 PASS Invalid: "class foo { set y({x, x}) { } }" 1071 PASS Invalid: "function f() { class foo { set y({x, x}) { } } }" 1072 PASS Invalid: "class foo { set y({x, field: {x}}) { } }" 1073 PASS Invalid: "function f() { class foo { set y({x, field: {x}}) { } } }" 1074 PASS Valid: "class foo { set y({x, field: {xx}}) { } }" 1075 PASS Valid: "function f() { class foo { set y({x, field: {xx}}) { } } }" 1042 1076 PASS Invalid: "({[...x]: 1})" 1043 1077 PASS Invalid: "function f() { ({[...x]: 1}) }" -
trunk/LayoutTests/js/script-tests/parser-syntax-check.js
r204895 r206590 630 630 valid("({set [x](x){}})") 631 631 invalid("({set [x (x){}})") 632 valid("({set foo(x) { } })"); 633 valid("({set foo(x) { 'use strict'; } })"); 634 invalid("({set foo(x = 20) { 'use strict'; } })"); 635 invalid("({set foo({x}) { 'use strict'; } })"); 636 invalid("({set foo([x]) { 'use strict'; } })"); 637 invalid("({set foo(...x) {} })"); 638 valid("class Foo { set v(z) { } }"); 639 valid("class Foo { set v(z) { 'use strict'; } }"); 640 invalid("class Foo { set v(z = 50) { 'use strict'; } }"); 641 invalid("class Foo { set v({z}) { 'use strict'; } }"); 642 invalid("class Foo { set v([z]) { 'use strict'; } }"); 643 invalid("class Foo { set v(...z) { } }"); 644 invalid("class foo { set y([x, y, x]) { } }"); 645 invalid("class foo { set y([x, y, {x}]) { } }"); 646 invalid("class foo { set y({x, x}) { } }"); 647 invalid("class foo { set y({x, field: {x}}) { } }"); 648 valid("class foo { set y({x, field: {xx}}) { } }"); 632 649 invalid("({[...x]: 1})") 633 650 invalid("function f({a, a}) {}"); -
trunk/Source/JavaScriptCore/ChangeLog
r206573 r206590 1 2016-09-29 Saam Barati <sbarati@apple.com> 2 3 We don't properly propagate non-simple-parameter-list when parsing a setter 4 https://bugs.webkit.org/show_bug.cgi?id=160483 5 6 Reviewed by Joseph Pecoraro. 7 8 * parser/Parser.cpp: 9 (JSC::Parser<LexerType>::parseFunctionParameters): 10 1 11 2016-09-28 Saam Barati <sbarati@apple.com> 2 12 -
trunk/Source/JavaScriptCore/parser/Parser.cpp
r206333 r206590 1995 1995 failIfTrue(match(CLOSEPAREN), "setter functions must have one parameter"); 1996 1996 const Identifier* duplicateParameter = nullptr; 1997 auto parameter = parseDestructuringPattern(context, DestructuringKind::DestructureToParameters, ExportType::NotExported, &duplicateParameter); 1997 bool hasDestructuringPattern = false; 1998 auto parameter = parseDestructuringPattern(context, DestructuringKind::DestructureToParameters, ExportType::NotExported, &duplicateParameter, &hasDestructuringPattern); 1998 1999 failIfFalse(parameter, "setter functions must have one parameter"); 1999 2000 auto defaultValue = parseDefaultValueForDestructuringPattern(context); 2000 2001 propagateError(); 2001 semanticFailIfTrue(duplicateParameter && defaultValue, "Duplicate parameter '", duplicateParameter->impl(), "' not allowed in function with default parameter values"); 2002 if (defaultValue || hasDestructuringPattern) { 2003 semanticFailIfTrue(duplicateParameter, "Duplicate parameter '", duplicateParameter->impl(), "' not allowed in function with non-simple parameter list"); 2004 currentScope()->setHasNonSimpleParameterList(); 2005 } 2002 2006 context.appendParameter(parameterList, parameter, defaultValue); 2003 2007 functionInfo.parameterCount = 1;
Note:
See TracChangeset
for help on using the changeset viewer.