X-Git-Url: http://git.webkit.org/?p=WebKit-https.git;a=blobdiff_plain;f=Source%2FJavaScriptCore%2Fparser%2FParser.cpp;h=645525b3fecb268b5649bfe45677e8b55ed5b749;hp=9b45da799c644b6614c53c33149543426c3a9d61;hb=45b975f55b2711026e1acf5e1792495fa5833519;hpb=6500fdbaa9e52945493104f6d677427b1dd79916 diff --git a/Source/JavaScriptCore/parser/Parser.cpp b/Source/JavaScriptCore/parser/Parser.cpp index 9b45da7..645525b 100644 --- a/Source/JavaScriptCore/parser/Parser.cpp +++ b/Source/JavaScriptCore/parser/Parser.cpp @@ -170,6 +170,14 @@ public: : SetForScope(scope->m_isGenerator, shouldParseAsGenerator) { } }; +struct DepthManager : private SetForScope { +public: + DepthManager(int* depth) + : SetForScope(*depth, *depth) + { + } +}; + template Parser::~Parser() { @@ -3319,11 +3327,14 @@ template TreeStatement Parser::parseExportDeclara result = parseClassDeclaration(context, ExportType::Exported); break; - case ASYNC: + case ASYNC: { next(); semanticFailIfFalse(match(FUNCTION) && !m_lexer->prevTerminator(), "Expected 'function' keyword following 'async' keyword with no preceding line terminator"); + DepthManager statementDepth(&m_statementDepth); + m_statementDepth = 1; result = parseAsyncFunctionDeclaration(context, ExportType::Exported); break; + } default: failWithMessage("Expected either a declaration or a variable statement");