Properly process Use Strict which contains EscapeSeqence or LineContinuation.

JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
This commit is contained in:
Andrey Shitov
2015-07-08 17:01:53 +03:00
parent 17cdc35d6d
commit d5fd0b09b1
3 changed files with 40 additions and 1 deletions
+2 -1
View File
@@ -2886,7 +2886,8 @@ preparse_scope (bool is_global)
*/
while (token_is (TOK_STRING))
{
if (lit_literal_equal_type_cstr (lit_get_literal_by_cp (token_data_as_lit_cp ()), "use strict"))
if (lit_literal_equal_type_cstr (lit_get_literal_by_cp (token_data_as_lit_cp ()), "use strict")
&& lexer_is_no_escape_sequences_in_token_string (tok))
{
scopes_tree_set_strict_mode (STACK_TOP (scopes), true);
is_use_strict = true;