[ES6] Arrow function syntax. Lexical bind super inside of the arrow function in generator.
https://bugs.webkit.org/show_bug.cgi?id=152575
Reviewed by Yusuke Suzuki.
Added support of the 'SuperProperty' in arrow function within of the generator
method of class. Before patch parser did not recognize that current arrow function
is declated inside of the generator and raise SyntaxError.
Source/JavaScriptCore:
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseFunctionInfo):
* parser/Parser.h:
(JSC::Scope::Scope):
(JSC::Scope::isGeneratorBoundary):
(JSC::Scope::setIsFunction):
(JSC::Scope::setIsGenerator):
(JSC::Parser::closestParentOrdinaryFunctionNonLexicalScope):
* tests/stress/arrowfunction-lexical-bind-superproperty.js:
LayoutTests:
* js/arrowfunction-superproperty-expected.txt:
* js/arrowfunction-syntax-errors-expected.txt:
* js/script-tests/arrowfunction-superproperty.js:
* js/script-tests/arrowfunction-syntax-errors.js:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@197554 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/js/arrowfunction-syntax-errors-expected.txt b/LayoutTests/js/arrowfunction-syntax-errors-expected.txt
index 7dcfcb0..cc38741 100644
--- a/LayoutTests/js/arrowfunction-syntax-errors-expected.txt
+++ b/LayoutTests/js/arrowfunction-syntax-errors-expected.txt
@@ -144,6 +144,7 @@
PASS class E { constructor() { function b () { return () => super; }; }} threw exception SyntaxError: Cannot reference super..
PASS class F { constructor() { function c () { return () => super.getValue(); }} threw exception SyntaxError: super can only be used in a method of a derived class..
PASS class G {}; class G2 extends G { getValue() { function c () { return () => super.getValue(); }} threw exception SyntaxError: super can only be used in a method of a derived class..
+PASS class H {}; class H2 extends H { method() { function *gen() { let arr = () => super.getValue(); arr(); } } } threw exception SyntaxError: super can only be used in a method of a derived class..
PASS successfullyParsed is true
TEST COMPLETE