2015-06-26 06:49:20 +00:00
Tests for ES6 arrow function syntax errors
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
2015-08-03 21:26:07 +00:00
PASS =>{} threw exception SyntaxError: Unexpected token '=>'.
2015-06-26 06:49:20 +00:00
PASS x=> threw exception SyntaxError: Unexpected end of script.
PASS x=>* threw exception SyntaxError: Unexpected token '*'.
Arrow functions with concise bodies cannot return regular expressions
https://bugs.webkit.org/show_bug.cgi?id=163162
Reviewed by Filip Pizlo.
JSTests:
* ChakraCore/test/Operators/instanceof.baseline-jsc:
* ChakraCore/test/Regex/nul_character.baseline-jsc:
* ChakraCore/test/es5/Lex_u3.baseline-jsc:
* stress/parse-regexp-as-token.js: Added.
(shouldBe):
Source/JavaScriptCore:
When we encounter the RegExp in the parser, we first scan it as / or /=.
And if / or /= is parsed under the primary expression context, we rescan it
as RegExp. However, we did not update the token record information. So the
token record still says "I'm / or /=".
When we parse the string "() => /hello/", the last token becomes "/", which is
the first character of the RegExp, instead of "/hello/". Since the arrow
function parsing utilizes the end offset of the last token, we accidentally
recognize the range of the above arrow function as "() => /".
In this patch, we update the token when rescanning under the RegExp context.
This logic is similar to parsing Tail Template Literal token.
We also refine the error message for regular expression literals. And since
the REGEXP token is now introduced, the other error messages using that token
are improved too.
Currently, unterminated error messages can be seen in Parser.cpp. However,
these messages cannot be shown to users if the lexer has m_error. So these
code is meaningless. I'll move these tokenizing errors to the lexer in the
subsequent patch[1].
[1]: https://bugs.webkit.org/show_bug.cgi?id=163928
* parser/Lexer.cpp:
(JSC::Lexer<T>::fillTokenInfo):
(JSC::Lexer<T>::lex):
(JSC::Lexer<T>::scanRegExp):
(JSC::Lexer<T>::scanTrailingTemplateString):
(JSC::Lexer<T>::skipRegExp): Deleted.
* parser/Lexer.h:
(JSC::Lexer::getToken):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseAssignmentExpression):
* parser/Parser.h:
(JSC::Parser::getToken):
* parser/ParserTokens.h:
LayoutTests:
* fast/regex/dom/non-pattern-characters-expected.txt:
* js/arrowfunction-syntax-errors-expected.txt:
* js/regexp-compile-crash-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.4_Comments/S7.4_A4_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.4_Comments/S7.4_A4_T4-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.2_T2-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.3_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.3_T3-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.5_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.5_T3-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.2_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.3_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.3_T3-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.5_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.5_T3-expected.txt:
Canonical link: https://commits.webkit.org/181658@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207798 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-25 02:35:59 +00:00
PASS x=>/ threw exception SyntaxError: Unterminated regular expression literal '/'.
2015-06-26 06:49:20 +00:00
PASS x=>% threw exception SyntaxError: Unexpected token '%'.
PASS x=>+ threw exception SyntaxError: Unexpected end of script.
PASS x=>- threw exception SyntaxError: Unexpected end of script.
PASS x=><< threw exception SyntaxError: Unexpected token '<<'.
PASS x=>>> threw exception SyntaxError: Unexpected token '>>'.
PASS x=>>>> threw exception SyntaxError: Unexpected token '>>>'.
PASS x=>< threw exception SyntaxError: Unexpected token '<'.
PASS x=>> threw exception SyntaxError: Unexpected token '>'.
PASS x=><= threw exception SyntaxError: Unexpected token '<='.
PASS x=>>= threw exception SyntaxError: Unexpected token '>='.
PASS x=>instanceof threw exception SyntaxError: Unexpected keyword 'instanceof'.
PASS x=>in threw exception SyntaxError: Unexpected keyword 'in'.
PASS x=>== threw exception SyntaxError: Unexpected token '=='.
PASS x=>!= threw exception SyntaxError: Unexpected token '!='.
PASS x=>=== threw exception SyntaxError: Unexpected token '==='.
PASS x=>!== threw exception SyntaxError: Unexpected token '!=='.
PASS x=>& threw exception SyntaxError: Unexpected token '&'.
PASS x=>^ threw exception SyntaxError: Unexpected token '^'.
PASS x=>| threw exception SyntaxError: Unexpected token '|'.
PASS x=>&& threw exception SyntaxError: Unexpected token '&&'.
PASS x=>|| threw exception SyntaxError: Unexpected token '||'.
PASS x=>; threw exception SyntaxError: Unexpected token ';'.
PASS x=>, threw exception SyntaxError: Unexpected token ','.
PASS x=>{ threw exception SyntaxError: Unexpected end of script.
PASS x=>{* threw exception SyntaxError: Unexpected token '*'.
Arrow functions with concise bodies cannot return regular expressions
https://bugs.webkit.org/show_bug.cgi?id=163162
Reviewed by Filip Pizlo.
JSTests:
* ChakraCore/test/Operators/instanceof.baseline-jsc:
* ChakraCore/test/Regex/nul_character.baseline-jsc:
* ChakraCore/test/es5/Lex_u3.baseline-jsc:
* stress/parse-regexp-as-token.js: Added.
(shouldBe):
Source/JavaScriptCore:
When we encounter the RegExp in the parser, we first scan it as / or /=.
And if / or /= is parsed under the primary expression context, we rescan it
as RegExp. However, we did not update the token record information. So the
token record still says "I'm / or /=".
When we parse the string "() => /hello/", the last token becomes "/", which is
the first character of the RegExp, instead of "/hello/". Since the arrow
function parsing utilizes the end offset of the last token, we accidentally
recognize the range of the above arrow function as "() => /".
In this patch, we update the token when rescanning under the RegExp context.
This logic is similar to parsing Tail Template Literal token.
We also refine the error message for regular expression literals. And since
the REGEXP token is now introduced, the other error messages using that token
are improved too.
Currently, unterminated error messages can be seen in Parser.cpp. However,
these messages cannot be shown to users if the lexer has m_error. So these
code is meaningless. I'll move these tokenizing errors to the lexer in the
subsequent patch[1].
[1]: https://bugs.webkit.org/show_bug.cgi?id=163928
* parser/Lexer.cpp:
(JSC::Lexer<T>::fillTokenInfo):
(JSC::Lexer<T>::lex):
(JSC::Lexer<T>::scanRegExp):
(JSC::Lexer<T>::scanTrailingTemplateString):
(JSC::Lexer<T>::skipRegExp): Deleted.
* parser/Lexer.h:
(JSC::Lexer::getToken):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseAssignmentExpression):
* parser/Parser.h:
(JSC::Parser::getToken):
* parser/ParserTokens.h:
LayoutTests:
* fast/regex/dom/non-pattern-characters-expected.txt:
* js/arrowfunction-syntax-errors-expected.txt:
* js/regexp-compile-crash-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.4_Comments/S7.4_A4_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.4_Comments/S7.4_A4_T4-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.2_T2-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.3_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.3_T3-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.5_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.5_T3-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.2_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.3_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.3_T3-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.5_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.5_T3-expected.txt:
Canonical link: https://commits.webkit.org/181658@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207798 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-25 02:35:59 +00:00
PASS x=>{/ threw exception SyntaxError: Unterminated regular expression literal '/'.
2015-06-26 06:49:20 +00:00
PASS x=>{% threw exception SyntaxError: Unexpected token '%'.
PASS x=>{+ threw exception SyntaxError: Unexpected end of script.
PASS x=>{- threw exception SyntaxError: Unexpected end of script.
PASS x=>{<< threw exception SyntaxError: Unexpected token '<<'.
PASS x=>{>> threw exception SyntaxError: Unexpected token '>>'.
PASS x=>{>>> threw exception SyntaxError: Unexpected token '>>>'.
PASS x=>{< threw exception SyntaxError: Unexpected token '<'.
PASS x=>{> threw exception SyntaxError: Unexpected token '>'.
PASS x=>{<= threw exception SyntaxError: Unexpected token '<='.
PASS x=>{>= threw exception SyntaxError: Unexpected token '>='.
PASS x=>{instanceof threw exception SyntaxError: Unexpected keyword 'instanceof'.
PASS x=>{in threw exception SyntaxError: Unexpected keyword 'in'.
PASS x=>{== threw exception SyntaxError: Unexpected token '=='.
PASS x=>{!= threw exception SyntaxError: Unexpected token '!='.
PASS x=>{=== threw exception SyntaxError: Unexpected token '==='.
PASS x=>{!== threw exception SyntaxError: Unexpected token '!=='.
PASS x=>{& threw exception SyntaxError: Unexpected token '&'.
PASS x=>{^ threw exception SyntaxError: Unexpected token '^'.
PASS x=>{| threw exception SyntaxError: Unexpected token '|'.
PASS x=>{&& threw exception SyntaxError: Unexpected token '&&'.
PASS x=>{|| threw exception SyntaxError: Unexpected token '||'.
PASS x=>{; threw exception SyntaxError: Unexpected end of script.
PASS x=>{, threw exception SyntaxError: Unexpected token ','.
PASS x=>} threw exception SyntaxError: Unexpected token '}'.
PASS var y = x=> threw exception SyntaxError: Unexpected end of script.
PASS var y = x=>* threw exception SyntaxError: Unexpected token '*'.
Arrow functions with concise bodies cannot return regular expressions
https://bugs.webkit.org/show_bug.cgi?id=163162
Reviewed by Filip Pizlo.
JSTests:
* ChakraCore/test/Operators/instanceof.baseline-jsc:
* ChakraCore/test/Regex/nul_character.baseline-jsc:
* ChakraCore/test/es5/Lex_u3.baseline-jsc:
* stress/parse-regexp-as-token.js: Added.
(shouldBe):
Source/JavaScriptCore:
When we encounter the RegExp in the parser, we first scan it as / or /=.
And if / or /= is parsed under the primary expression context, we rescan it
as RegExp. However, we did not update the token record information. So the
token record still says "I'm / or /=".
When we parse the string "() => /hello/", the last token becomes "/", which is
the first character of the RegExp, instead of "/hello/". Since the arrow
function parsing utilizes the end offset of the last token, we accidentally
recognize the range of the above arrow function as "() => /".
In this patch, we update the token when rescanning under the RegExp context.
This logic is similar to parsing Tail Template Literal token.
We also refine the error message for regular expression literals. And since
the REGEXP token is now introduced, the other error messages using that token
are improved too.
Currently, unterminated error messages can be seen in Parser.cpp. However,
these messages cannot be shown to users if the lexer has m_error. So these
code is meaningless. I'll move these tokenizing errors to the lexer in the
subsequent patch[1].
[1]: https://bugs.webkit.org/show_bug.cgi?id=163928
* parser/Lexer.cpp:
(JSC::Lexer<T>::fillTokenInfo):
(JSC::Lexer<T>::lex):
(JSC::Lexer<T>::scanRegExp):
(JSC::Lexer<T>::scanTrailingTemplateString):
(JSC::Lexer<T>::skipRegExp): Deleted.
* parser/Lexer.h:
(JSC::Lexer::getToken):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseAssignmentExpression):
* parser/Parser.h:
(JSC::Parser::getToken):
* parser/ParserTokens.h:
LayoutTests:
* fast/regex/dom/non-pattern-characters-expected.txt:
* js/arrowfunction-syntax-errors-expected.txt:
* js/regexp-compile-crash-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.4_Comments/S7.4_A4_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.4_Comments/S7.4_A4_T4-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.2_T2-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.3_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.3_T3-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.5_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.5_T3-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.2_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.3_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.3_T3-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.5_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.5_T3-expected.txt:
Canonical link: https://commits.webkit.org/181658@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207798 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-25 02:35:59 +00:00
PASS var y = x=>/ threw exception SyntaxError: Unterminated regular expression literal '/'.
2015-06-26 06:49:20 +00:00
PASS var y = x=>% threw exception SyntaxError: Unexpected token '%'.
PASS var y = x=>+ threw exception SyntaxError: Unexpected end of script.
PASS var y = x=>- threw exception SyntaxError: Unexpected end of script.
PASS var y = x=><< threw exception SyntaxError: Unexpected token '<<'.
PASS var y = x=>>> threw exception SyntaxError: Unexpected token '>>'.
PASS var y = x=>>>> threw exception SyntaxError: Unexpected token '>>>'.
PASS var y = x=>< threw exception SyntaxError: Unexpected token '<'.
PASS var y = x=>> threw exception SyntaxError: Unexpected token '>'.
PASS var y = x=><= threw exception SyntaxError: Unexpected token '<='.
PASS var y = x=>>= threw exception SyntaxError: Unexpected token '>='.
PASS var y = x=>instanceof threw exception SyntaxError: Unexpected keyword 'instanceof'.
PASS var y = x=>in threw exception SyntaxError: Unexpected keyword 'in'.
PASS var y = x=>== threw exception SyntaxError: Unexpected token '=='.
PASS var y = x=>!= threw exception SyntaxError: Unexpected token '!='.
PASS var y = x=>=== threw exception SyntaxError: Unexpected token '==='.
PASS var y = x=>!== threw exception SyntaxError: Unexpected token '!=='.
PASS var y = x=>& threw exception SyntaxError: Unexpected token '&'.
PASS var y = x=>^ threw exception SyntaxError: Unexpected token '^'.
PASS var y = x=>| threw exception SyntaxError: Unexpected token '|'.
PASS var y = x=>&& threw exception SyntaxError: Unexpected token '&&'.
PASS var y = x=>|| threw exception SyntaxError: Unexpected token '||'.
PASS var y = x=>; threw exception SyntaxError: Unexpected token ';'.
PASS var y = x=>, threw exception SyntaxError: Unexpected token ','.
PASS var y = x=>{ threw exception SyntaxError: Unexpected end of script.
PASS var y = x=>{* threw exception SyntaxError: Unexpected token '*'.
Arrow functions with concise bodies cannot return regular expressions
https://bugs.webkit.org/show_bug.cgi?id=163162
Reviewed by Filip Pizlo.
JSTests:
* ChakraCore/test/Operators/instanceof.baseline-jsc:
* ChakraCore/test/Regex/nul_character.baseline-jsc:
* ChakraCore/test/es5/Lex_u3.baseline-jsc:
* stress/parse-regexp-as-token.js: Added.
(shouldBe):
Source/JavaScriptCore:
When we encounter the RegExp in the parser, we first scan it as / or /=.
And if / or /= is parsed under the primary expression context, we rescan it
as RegExp. However, we did not update the token record information. So the
token record still says "I'm / or /=".
When we parse the string "() => /hello/", the last token becomes "/", which is
the first character of the RegExp, instead of "/hello/". Since the arrow
function parsing utilizes the end offset of the last token, we accidentally
recognize the range of the above arrow function as "() => /".
In this patch, we update the token when rescanning under the RegExp context.
This logic is similar to parsing Tail Template Literal token.
We also refine the error message for regular expression literals. And since
the REGEXP token is now introduced, the other error messages using that token
are improved too.
Currently, unterminated error messages can be seen in Parser.cpp. However,
these messages cannot be shown to users if the lexer has m_error. So these
code is meaningless. I'll move these tokenizing errors to the lexer in the
subsequent patch[1].
[1]: https://bugs.webkit.org/show_bug.cgi?id=163928
* parser/Lexer.cpp:
(JSC::Lexer<T>::fillTokenInfo):
(JSC::Lexer<T>::lex):
(JSC::Lexer<T>::scanRegExp):
(JSC::Lexer<T>::scanTrailingTemplateString):
(JSC::Lexer<T>::skipRegExp): Deleted.
* parser/Lexer.h:
(JSC::Lexer::getToken):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseAssignmentExpression):
* parser/Parser.h:
(JSC::Parser::getToken):
* parser/ParserTokens.h:
LayoutTests:
* fast/regex/dom/non-pattern-characters-expected.txt:
* js/arrowfunction-syntax-errors-expected.txt:
* js/regexp-compile-crash-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.4_Comments/S7.4_A4_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.4_Comments/S7.4_A4_T4-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.2_T2-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.3_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.3_T3-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.5_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.5_T3-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.2_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.3_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.3_T3-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.5_T1-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.5_T3-expected.txt:
Canonical link: https://commits.webkit.org/181658@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207798 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-25 02:35:59 +00:00
PASS var y = x=>{/ threw exception SyntaxError: Unterminated regular expression literal '/'.
2015-06-26 06:49:20 +00:00
PASS var y = x=>{% threw exception SyntaxError: Unexpected token '%'.
PASS var y = x=>{+ threw exception SyntaxError: Unexpected end of script.
PASS var y = x=>{- threw exception SyntaxError: Unexpected end of script.
PASS var y = x=>{<< threw exception SyntaxError: Unexpected token '<<'.
PASS var y = x=>{>> threw exception SyntaxError: Unexpected token '>>'.
PASS var y = x=>{>>> threw exception SyntaxError: Unexpected token '>>>'.
PASS var y = x=>{< threw exception SyntaxError: Unexpected token '<'.
PASS var y = x=>{> threw exception SyntaxError: Unexpected token '>'.
PASS var y = x=>{<= threw exception SyntaxError: Unexpected token '<='.
PASS var y = x=>{>= threw exception SyntaxError: Unexpected token '>='.
PASS var y = x=>{instanceof threw exception SyntaxError: Unexpected keyword 'instanceof'.
PASS var y = x=>{in threw exception SyntaxError: Unexpected keyword 'in'.
PASS var y = x=>{== threw exception SyntaxError: Unexpected token '=='.
PASS var y = x=>{!= threw exception SyntaxError: Unexpected token '!='.
PASS var y = x=>{=== threw exception SyntaxError: Unexpected token '==='.
PASS var y = x=>{!== threw exception SyntaxError: Unexpected token '!=='.
PASS var y = x=>{& threw exception SyntaxError: Unexpected token '&'.
PASS var y = x=>{^ threw exception SyntaxError: Unexpected token '^'.
PASS var y = x=>{| threw exception SyntaxError: Unexpected token '|'.
PASS var y = x=>{&& threw exception SyntaxError: Unexpected token '&&'.
PASS var y = x=>{|| threw exception SyntaxError: Unexpected token '||'.
PASS var y = x=>{; threw exception SyntaxError: Unexpected end of script.
PASS var y = x=>{, threw exception SyntaxError: Unexpected token ','.
PASS var y = x=>} threw exception SyntaxError: Unexpected token '}'.
2015-08-03 21:26:07 +00:00
PASS var t = x=>x+1; =>{} threw exception SyntaxError: Unexpected token '=>'.
PASS [=>x+1] threw exception SyntaxError: Unexpected token '=>'.
PASS [x=>x+1, =>x+1] threw exception SyntaxError: Unexpected token '=>'.
PASS var f=>x+1; threw exception SyntaxError: Unexpected token '=>'. Expected ';' after variable declaration..
PASS var x, y=>y+1; threw exception SyntaxError: Unexpected token '=>'. Expected ';' after variable declaration..
PASS debug(=>x+1) threw exception SyntaxError: Unexpected token '=>'.
PASS debug("xyz", =>x+1) threw exception SyntaxError: Unexpected token '=>'.
2015-06-28 16:18:26 +00:00
PASS var af1=y
2015-08-03 21:26:07 +00:00
=>y+1 threw exception SyntaxError: Unexpected token '=>'.
2015-06-28 16:18:26 +00:00
PASS var af2=(y)
2015-08-03 21:26:07 +00:00
=>y+1 threw exception SyntaxError: Unexpected token '=>'.
2015-06-28 16:18:26 +00:00
PASS var af3=(x, y)
2015-08-03 21:26:07 +00:00
=>y+1 threw exception SyntaxError: Unexpected token '=>'.
2016-01-17 00:04:37 +00:00
PASS ([a, b] => a + b)(["a_", "b_"]) threw exception SyntaxError: Unexpected token '=>'. Expected ')' to end a compound expression..
PASS ({a, b} => a + b)({a:"a_", b:"b_"}) threw exception SyntaxError: Unexpected token '=>'. Expected ')' to end a compound expression..
PASS ({c:a,d:b} => a + b)({c:"a_", d:"b_"}) threw exception SyntaxError: Unexpected token '=>'. Expected ')' to end a compound expression..
PASS ({c:b,d:a} => a + b)({c:"a_", d:"b_"}) threw exception SyntaxError: Unexpected token '=>'. Expected ')' to end a compound expression..
PASS var arr1 = [a, b] => a + b; threw exception SyntaxError: Unexpected token '=>'. Expected ';' after variable declaration..
PASS var arr2 = {a, b} => a + b; threw exception SyntaxError: Unexpected token '=>'. Expected ';' after variable declaration..
PASS var arr3 = {c:a,d:b} => a + b; threw exception SyntaxError: Unexpected token '=>'. Expected ';' after variable declaration..
PASS var arr3 = {c:b,d:a} => a + b; threw exception SyntaxError: Unexpected token '=>'. Expected ';' after variable declaration..
2016-04-22 23:04:55 +00:00
PASS var arr4 = () => { super(); }; threw exception SyntaxError: super is not valid in this context..
PASS var arr4 = () => { super; }; threw exception SyntaxError: super is not valid in this context..
PASS var arr5 = () => { super.getValue(); }; threw exception SyntaxError: super is not valid in this context..
PASS var arr6 = () => super(); threw exception SyntaxError: super is not valid in this context..
PASS var arr7 = () => super; threw exception SyntaxError: super is not valid in this context..
PASS var arr8 = () => super.getValue(); threw exception SyntaxError: super is not valid in this context..
PASS class A { constructor() { function a () { return () => { super(); };}} threw exception SyntaxError: super is not valid in this context..
PASS class B { constructor() { function b () { return () => { super; }; }; }} threw exception SyntaxError: super is not valid in this context..
PASS class C { constructor() { function c () { return () => { super.getValue(); };}} threw exception SyntaxError: super is not valid in this context..
PASS class D { constructor() { function a () { return () => super(); }} threw exception SyntaxError: super is not valid in this context..
PASS class E { constructor() { function b () { return () => super; }; }} threw exception SyntaxError: super is not valid in this context..
PASS class F { constructor() { function c () { return () => super.getValue(); }} threw exception SyntaxError: super is not valid in this context..
PASS class G {}; class G2 extends G { getValue() { function c () { return () => super.getValue(); }} threw exception SyntaxError: super is not valid in this context..
PASS class H {}; class H2 extends H { method() { function *gen() { let arr = () => super.getValue(); arr(); } } } threw exception SyntaxError: super is not valid in this context..
2015-06-26 06:49:20 +00:00
PASS successfullyParsed is true
TEST COMPLETE