Ignore:
Timestamp:
Aug 13, 2015, 4:55:35 PM (10 years ago)
Author:
Yusuke Suzuki
Message:

Unify JSParserCodeType, FunctionParseMode and ModuleParseMode into SourceParseMode
https://bugs.webkit.org/show_bug.cgi?id=147353

Reviewed by Saam Barati.

This is the follow-up patch after r188355.
It includes the following changes.

  • Unify JSParserCodeType, FunctionParseMode and ModuleParseMode into SourceParseMode
  • Make SourceParseMode to C++ strongly-typed enum.
  • Fix the comments.
  • Rename ModuleSpecifier to ModuleName.
  • Add the type name ImportEntry before the C++11 uniform initialization.
  • Fix the thrown message for duplicate 'default' names.
  • Assert the all statements in the top-level source elements are the module declarations under the module analyzer phase.
  • API/JSScriptRef.cpp:

(parseScript):

  • builtins/BuiltinExecutables.cpp:

(JSC::BuiltinExecutables::createExecutableInternal):

  • bytecode/UnlinkedFunctionExecutable.cpp:

(JSC::generateFunctionCodeBlock):

  • bytecode/UnlinkedFunctionExecutable.h:
  • bytecompiler/BytecodeGenerator.h:

(JSC::BytecodeGenerator::makeFunction):

  • parser/ASTBuilder.h:

(JSC::ASTBuilder::createFunctionMetadata):
(JSC::ASTBuilder::createModuleName):
(JSC::ASTBuilder::createImportDeclaration):
(JSC::ASTBuilder::createExportAllDeclaration):
(JSC::ASTBuilder::createExportNamedDeclaration):
(JSC::ASTBuilder::createModuleSpecifier): Deleted.

  • parser/ModuleAnalyzer.cpp:

(JSC::ModuleAnalyzer::analyze):

  • parser/NodeConstructors.h:

(JSC::ModuleNameNode::ModuleNameNode):
(JSC::ImportDeclarationNode::ImportDeclarationNode):
(JSC::ExportAllDeclarationNode::ExportAllDeclarationNode):
(JSC::ExportNamedDeclarationNode::ExportNamedDeclarationNode):
(JSC::ModuleSpecifierNode::ModuleSpecifierNode): Deleted.

  • parser/Nodes.cpp:

(JSC::FunctionMetadataNode::FunctionMetadataNode):

  • parser/Nodes.h:

(JSC::StatementNode::isModuleDeclarationNode):
(JSC::ModuleDeclarationNode::isModuleDeclarationNode):
(JSC::ImportDeclarationNode::moduleName):
(JSC::ExportAllDeclarationNode::moduleName):
(JSC::ExportNamedDeclarationNode::moduleName):
(JSC::ImportDeclarationNode::moduleSpecifier): Deleted.
(JSC::ExportAllDeclarationNode::moduleSpecifier): Deleted.
(JSC::ExportNamedDeclarationNode::moduleSpecifier): Deleted.

  • parser/NodesAnalyzeModule.cpp:

(JSC::SourceElements::analyzeModule):
(JSC::ImportDeclarationNode::analyzeModule):
(JSC::ExportAllDeclarationNode::analyzeModule):
(JSC::ExportNamedDeclarationNode::analyzeModule):

  • parser/Parser.cpp:

(JSC::Parser<LexerType>::Parser):
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::parseModuleSourceElements):
(JSC::Parser<LexerType>::parseFunctionBody):
(JSC::stringForFunctionMode):
(JSC::Parser<LexerType>::parseFunctionParameters):
(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::Parser<LexerType>::parseFunctionDeclaration):
(JSC::Parser<LexerType>::parseClass):
(JSC::Parser<LexerType>::parseModuleName):
(JSC::Parser<LexerType>::parseImportDeclaration):
(JSC::Parser<LexerType>::parseExportDeclaration):
(JSC::Parser<LexerType>::parsePropertyMethod):
(JSC::Parser<LexerType>::parseGetterSetter):
(JSC::Parser<LexerType>::parsePrimaryExpression):
(JSC::Parser<LexerType>::parseArrowFunctionExpression):
(JSC::Parser<LexerType>::parseModuleSpecifier): Deleted.

  • parser/Parser.h:

(JSC::Parser<LexerType>::parse):
(JSC::parse):

  • parser/ParserModes.h:

(JSC::isFunctionParseMode):
(JSC::isModuleParseMode):
(JSC::isProgramParseMode):

  • parser/SyntaxChecker.h:

(JSC::SyntaxChecker::createFunctionMetadata):
(JSC::SyntaxChecker::createModuleName):
(JSC::SyntaxChecker::createImportDeclaration):
(JSC::SyntaxChecker::createExportAllDeclaration):
(JSC::SyntaxChecker::createExportNamedDeclaration):
(JSC::SyntaxChecker::createModuleSpecifier): Deleted.

  • runtime/CodeCache.cpp:

(JSC::CodeCache::getGlobalCodeBlock):
(JSC::CodeCache::getFunctionExecutableFromGlobalCode):

  • runtime/Completion.cpp:

(JSC::checkSyntax):
(JSC::checkModuleSyntax):

  • runtime/Executable.cpp:

(JSC::ProgramExecutable::checkSyntax):

  • tests/stress/modules-syntax-error-with-names.js:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/Parser.cpp

    r188355 r188417  
    193193Parser<LexerType>::Parser(
    194194    VM* vm, const SourceCode& source, JSParserBuiltinMode builtinMode,
    195     JSParserStrictMode strictMode, JSParserCodeType codeType,
     195    JSParserStrictMode strictMode, SourceParseMode parseMode,
    196196    ConstructorKind defaultConstructorKind, ThisTDZMode thisTDZMode)
    197197    : m_vm(vm)
     
    210210    , m_defaultConstructorKind(defaultConstructorKind)
    211211    , m_thisTDZMode(thisTDZMode)
    212     , m_codeType(codeType)
    213212{
    214213    m_lexer = std::make_unique<LexerType>(vm, builtinMode);
     
    220219    m_functionCache = vm->addSourceProviderCache(source.provider());
    221220    ScopeRef scope = pushScope();
    222     if (codeType == JSParserCodeType::Function)
     221    if (isFunctionParseMode(parseMode))
    223222        scope->setIsFunction();
    224     if (codeType == JSParserCodeType::Module)
     223    if (isModuleParseMode(parseMode))
    225224        scope->setIsModule();
    226225    if (strictMode == JSParserStrictMode::Strict)
     
    236235
    237236template <typename LexerType>
    238 String Parser<LexerType>::parseInner(const Identifier& calleeName, FunctionParseMode parseMode, ModuleParseMode moduleParseMode)
    239 {
    240     UNUSED_PARAM(moduleParseMode);
    241 
     237String Parser<LexerType>::parseInner(const Identifier& calleeName, SourceParseMode parseMode)
     238{
    242239    String parseError = String();
    243    
     240
    244241    ASTBuilder context(const_cast<VM*>(m_vm), m_parserArena, const_cast<SourceCode*>(m_source));
    245242    ScopeRef scope = currentScope();
     
    253250
    254251#if ENABLE(ES6_ARROWFUNCTION_SYNTAX)
    255         if (parseMode == ArrowFunctionMode && !hasError()) {
     252        if (parseMode == SourceParseMode::ArrowFunctionMode && !hasError()) {
    256253            // The only way we could have an error wile reparsing is if we run out of stack space.
    257254            RELEASE_ASSERT(match(ARROWFUNCTION));
     
    274271            sourceElements = parseArrowFunctionSingleExpressionBodySourceElements(context);
    275272#if ENABLE(ES6_MODULES)
    276         else if (m_codeType == JSParserCodeType::Module)
    277             sourceElements = parseModuleSourceElements(context, moduleParseMode);
     273        else if (isModuleParseMode(parseMode))
     274            sourceElements = parseModuleSourceElements(context, parseMode);
    278275#endif
    279276        else
     
    415412
    416413template <typename LexerType>
    417 template <class TreeBuilder> TreeSourceElements Parser<LexerType>::parseModuleSourceElements(TreeBuilder& context, ModuleParseMode moduleParseMode)
     414template <class TreeBuilder> TreeSourceElements Parser<LexerType>::parseModuleSourceElements(TreeBuilder& context, SourceParseMode parseMode)
    418415{
    419416    TreeSourceElements sourceElements = context.createSourceElements();
     
    429426            const Identifier* directive = 0;
    430427            unsigned directiveLiteralLength = 0;
    431             if (moduleParseMode == ModuleParseMode::Analyze) {
     428            if (parseMode == SourceParseMode::ModuleAnalyzeMode) {
    432429                if (!parseStatementListItem(syntaxChecker, directive, &directiveLiteralLength))
    433430                    break;
     
    15481545template <class TreeBuilder> TreeFunctionBody Parser<LexerType>::parseFunctionBody(
    15491546    TreeBuilder& context, const JSTokenLocation& startLocation, int startColumn, int functionKeywordStart, int functionNameStart, int parametersStart,
    1550     ConstructorKind constructorKind, FunctionBodyType bodyType, unsigned parameterCount, FunctionParseMode parseMode)
     1547    ConstructorKind constructorKind, FunctionBodyType bodyType, unsigned parameterCount, SourceParseMode parseMode)
    15511548{
    15521549    if (bodyType == StandardFunctionBodyBlock || bodyType == ArrowFunctionBodyBlock) {
     
    15691566}
    15701567
    1571 static const char* stringForFunctionMode(FunctionParseMode mode)
     1568static const char* stringForFunctionMode(SourceParseMode mode)
    15721569{
    15731570    switch (mode) {
    1574     case GetterMode:
     1571    case SourceParseMode::GetterMode:
    15751572        return "getter";
    1576     case SetterMode:
     1573    case SourceParseMode::SetterMode:
    15771574        return "setter";
    1578     case NormalFunctionMode:
     1575    case SourceParseMode::NormalFunctionMode:
    15791576        return "function";
    1580     case MethodMode:
     1577    case SourceParseMode::MethodMode:
    15811578        return "method";
    1582     case ArrowFunctionMode:
     1579    case SourceParseMode::ArrowFunctionMode:
    15831580        return "arrow function";
    1584     case NotAFunctionMode:
     1581    case SourceParseMode::ProgramMode:
     1582    case SourceParseMode::ModuleAnalyzeMode:
     1583    case SourceParseMode::ModuleEvaluateMode:
    15851584        RELEASE_ASSERT_NOT_REACHED();
    15861585        return "";
     
    15901589}
    15911590
    1592 template <typename LexerType> template <class TreeBuilder> int Parser<LexerType>::parseFunctionParameters(TreeBuilder& context, FunctionParseMode mode, ParserFunctionInfo<TreeBuilder>& functionInfo)
    1593 {
    1594     RELEASE_ASSERT(mode != NotAFunctionMode);
     1591template <typename LexerType> template <class TreeBuilder> int Parser<LexerType>::parseFunctionParameters(TreeBuilder& context, SourceParseMode mode, ParserFunctionInfo<TreeBuilder>& functionInfo)
     1592{
     1593    RELEASE_ASSERT(mode != SourceParseMode::ProgramMode && mode != SourceParseMode::ModuleAnalyzeMode && mode != SourceParseMode::ModuleEvaluateMode);
    15951594    int parametersStart = m_token.m_location.startOffset;
    15961595    TreeFormalParameterList parameterList = context.createFormalParameterList();
     
    15981597    functionInfo.startOffset = parametersStart;
    15991598   
    1600     if (mode == ArrowFunctionMode) {
     1599    if (mode == SourceParseMode::ArrowFunctionMode) {
    16011600        if (!match(IDENT) && !match(OPENPAREN)) {
    16021601            semanticFailureDueToKeyword(stringForFunctionMode(mode), " name");
     
    16281627    }
    16291628
    1630     if (mode == GetterMode) {
     1629    if (mode == SourceParseMode::GetterMode) {
    16311630        consumeOrFail(CLOSEPAREN, "getter functions must have no parameters");
    16321631        functionInfo.parameterCount = 0;
    1633     } else if (mode == SetterMode) {
     1632    } else if (mode == SourceParseMode::SetterMode) {
    16341633        failIfTrue(match(CLOSEPAREN), "setter functions must have one parameter");
    16351634        const Identifier* duplicateParameter = nullptr;
     
    16551654
    16561655template <typename LexerType>
    1657 template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuilder& context, FunctionRequirements requirements, FunctionParseMode mode, bool nameIsInContainingScope, ConstructorKind constructorKind, SuperBinding expectedSuperBinding, int functionKeywordStart, ParserFunctionInfo<TreeBuilder>& functionInfo, FunctionParseType parseType)
    1658 {
    1659     RELEASE_ASSERT(mode != NotAFunctionMode);
     1656template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuilder& context, FunctionRequirements requirements, SourceParseMode mode, bool nameIsInContainingScope, ConstructorKind constructorKind, SuperBinding expectedSuperBinding, int functionKeywordStart, ParserFunctionInfo<TreeBuilder>& functionInfo, FunctionParseType parseType)
     1657{
     1658    RELEASE_ASSERT(isFunctionParseMode(mode));
    16601659
    16611660    AutoPopScopeRef functionScope(this, pushScope());
     
    16711670    switch (parseType) {
    16721671    case StandardFunctionParseType: {
    1673         RELEASE_ASSERT(mode != ArrowFunctionMode);
     1672        RELEASE_ASSERT(mode != SourceParseMode::ArrowFunctionMode);
    16741673        if (match(IDENT) || isLETMaskedAsIDENT()) {
    16751674            functionInfo.name = m_token.m_data.ident;
     
    16791678                failIfTrueIfStrict(functionScope->declareVariable(functionInfo.name) & DeclarationResult::InvalidStrictMode, "'", functionInfo.name->impl(), "' is not a valid ", stringForFunctionMode(mode), " name in strict mode");
    16801679        } else if (requirements == FunctionNeedsName) {
    1681             if (match(OPENPAREN) && mode == NormalFunctionMode)
     1680            if (match(OPENPAREN) && mode == SourceParseMode::NormalFunctionMode)
    16821681                semanticFail("Function statements must have a name");
    16831682            semanticFailureDueToKeyword(stringForFunctionMode(mode), " name");
     
    17091708#if ENABLE(ES6_ARROWFUNCTION_SYNTAX)
    17101709    case ArrowFunctionParseType: {
    1711         RELEASE_ASSERT(mode == ArrowFunctionMode);
     1710        RELEASE_ASSERT(mode == SourceParseMode::ArrowFunctionMode);
    17121711
    17131712        startLocation = tokenLocation();
     
    18051804    context.setEndOffset(functionInfo.body, m_lexer->currentOffset());
    18061805    if (functionScope->strictMode() && functionInfo.name) {
    1807         RELEASE_ASSERT(mode == NormalFunctionMode || mode == MethodMode || mode == ArrowFunctionMode);
     1806        RELEASE_ASSERT(mode == SourceParseMode::NormalFunctionMode || mode == SourceParseMode::MethodMode || mode == SourceParseMode::ArrowFunctionMode);
    18081807        semanticFailIfTrue(m_vm->propertyNames->arguments == *functionInfo.name, "'", functionInfo.name->impl(), "' is not a valid function name in strict mode");
    18091808        semanticFailIfTrue(m_vm->propertyNames->eval == *functionInfo.name, "'", functionInfo.name->impl(), "' is not a valid function name in strict mode");
     
    18701869    next();
    18711870    ParserFunctionInfo<TreeBuilder> functionInfo;
    1872     failIfFalse((parseFunctionInfo(context, FunctionNeedsName, NormalFunctionMode, true, ConstructorKind::None, SuperBinding::NotNeeded,
     1871    failIfFalse((parseFunctionInfo(context, FunctionNeedsName, SourceParseMode::NormalFunctionMode, true, ConstructorKind::None, SuperBinding::NotNeeded,
    18731872        functionKeywordStart, functionInfo, StandardFunctionParseType)), "Cannot parse this function");
    18741873    failIfFalse(functionInfo.name, "Function statements must have a name");
     
    20001999            ParserFunctionInfo<TreeBuilder> methodInfo;
    20012000            bool isConstructor = !isStaticMethod && *ident == propertyNames.constructor;
    2002             failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, MethodMode, false, isConstructor ? constructorKind : ConstructorKind::None, SuperBinding::Needed, methodStart, methodInfo, StandardFunctionParseType)), "Cannot parse this method");
     2001            failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SourceParseMode::MethodMode, false, isConstructor ? constructorKind : ConstructorKind::None, SuperBinding::Needed, methodStart, methodInfo, StandardFunctionParseType)), "Cannot parse this method");
    20032002            failIfTrue(!ident || (declareVariable(ident) & DeclarationResult::InvalidStrictMode), "Cannot declare a method named '", methodInfo.name->impl(), "'");
    20042003            methodInfo.name = isConstructor ? className : ident;
     
    22272226
    22282227template <typename LexerType>
    2229 template <class TreeBuilder> typename TreeBuilder::ModuleSpecifier Parser<LexerType>::parseModuleSpecifier(TreeBuilder& context)
    2230 {
    2231     // ModuleSpecifier represents the module name imported by the script.
     2228template <class TreeBuilder> typename TreeBuilder::ModuleName Parser<LexerType>::parseModuleName(TreeBuilder& context)
     2229{
     2230    // ModuleName (ModuleSpecifier in the spec) represents the module name imported by the script.
    22322231    // http://www.ecma-international.org/ecma-262/6.0/#sec-imports
    22332232    // http://www.ecma-international.org/ecma-262/6.0/#sec-exports
     
    22362235    const Identifier* moduleName = m_token.m_data.ident;
    22372236    next();
    2238     return context.createModuleSpecifier(specifierLocation, *moduleName);
     2237    return context.createModuleName(specifierLocation, *moduleName);
    22392238}
    22402239
     
    23282327    if (match(STRING)) {
    23292328        // import ModuleSpecifier ;
    2330         auto moduleSpecifier = parseModuleSpecifier(context);
    2331         failIfFalse(moduleSpecifier, "Cannot parse the module name");
     2329        auto moduleName = parseModuleName(context);
     2330        failIfFalse(moduleName, "Cannot parse the module name");
    23322331        failIfFalse(autoSemiColon(), "Expected a ';' following a targeted import declaration");
    2333         return context.createImportDeclaration(importLocation, specifierList, moduleSpecifier);
     2332        return context.createImportDeclaration(importLocation, specifierList, moduleName);
    23342333    }
    23352334
     
    23792378    next();
    23802379
    2381     auto moduleSpecifier = parseModuleSpecifier(context);
    2382     failIfFalse(moduleSpecifier, "Cannot parse the module name");
     2380    auto moduleName = parseModuleName(context);
     2381    failIfFalse(moduleName, "Cannot parse the module name");
    23832382    failIfFalse(autoSemiColon(), "Expected a ';' following a targeted import declaration");
    23842383
    2385     return context.createImportDeclaration(importLocation, specifierList, moduleSpecifier);
     2384    return context.createImportDeclaration(importLocation, specifierList, moduleName);
    23862385}
    23872386
     
    24282427        failIfFalse(matchContextualKeyword(m_vm->propertyNames->from), "Expected 'from' before exported module name");
    24292428        next();
    2430         auto moduleSpecifier = parseModuleSpecifier(context);
    2431         failIfFalse(moduleSpecifier, "Cannot parse the 'from' clause");
     2429        auto moduleName = parseModuleName(context);
     2430        failIfFalse(moduleName, "Cannot parse the 'from' clause");
    24322431        failIfFalse(autoSemiColon(), "Expected a ';' following a targeted export declaration");
    24332432
    2434         return context.createExportAllDeclaration(exportLocation, moduleSpecifier);
     2433        return context.createExportAllDeclaration(exportLocation, moduleName);
    24352434    }
    24362435
     
    24752474            // const *default* = expr;
    24762475            // export { *default* as default }
     2476            //
     2477            // In the above example, *default* is the invisible variable to the users.
     2478            // We use the private symbol to represent the name of this variable.
    24772479            JSTokenLocation location(tokenLocation());
    24782480            JSTextPosition start = tokenStartPosition();
     
    24822484            DeclarationResultMask declarationResult = declareVariable(&m_vm->propertyNames->starDefaultPrivateName, DeclarationType::ConstDeclaration);
    24832485            if (declarationResult & DeclarationResult::InvalidDuplicateDeclaration)
    2484                 internalFailWithMessage(false, "Cannot export 'default' name twice: '");
     2486                internalFailWithMessage(false, "Only one 'default' export is allowed");
    24852487
    24862488            TreeExpression assignment = context.createAssignResolve(location, m_vm->propertyNames->starDefaultPrivateName, expression, start, start, tokenEndPosition(), AssignmentContext::ConstDeclarationStatement);
     
    24922494        failIfFalse(result, "Cannot parse the declaration");
    24932495
    2494         semanticFailIfFalse(exportName(m_vm->propertyNames->defaultKeyword), "Cannot export 'default' name twice.");
     2496        semanticFailIfFalse(exportName(m_vm->propertyNames->defaultKeyword), "Only one 'default' export is allowed");
    24952497        currentScope()->moduleScopeData().exportBinding(*localName);
    24962498        return context.createExportDefaultDeclaration(exportLocation, result, *localName);
     
    25262528        handleProductionOrFail(CLOSEBRACE, "}", "end", "export list");
    25272529
    2528         typename TreeBuilder::ModuleSpecifier moduleSpecifier = 0;
     2530        typename TreeBuilder::ModuleName moduleName = 0;
    25292531        if (matchContextualKeyword(m_vm->propertyNames->from)) {
    25302532            next();
    2531             moduleSpecifier = parseModuleSpecifier(context);
    2532             failIfFalse(moduleSpecifier, "Cannot parse the 'from' clause");
     2533            moduleName = parseModuleName(context);
     2534            failIfFalse(moduleName, "Cannot parse the 'from' clause");
    25332535        }
    25342536        failIfFalse(autoSemiColon(), "Expected a ';' following a targeted export declaration");
    25352537
    2536         if (!moduleSpecifier) {
     2538        if (!moduleName) {
    25372539            semanticFailIfTrue(hasKeywordForLocalBindings, "Cannot use keyword as exported variable name");
    25382540            // Since this export declaration does not have module specifier part, it exports the local bindings.
     
    25502552        }
    25512553
    2552         return context.createExportNamedDeclaration(exportLocation, specifierList, moduleSpecifier);
     2554        return context.createExportNamedDeclaration(exportLocation, specifierList, moduleName);
    25532555    }
    25542556
     
    28872889    unsigned methodStart = tokenStart();
    28882890    ParserFunctionInfo<TreeBuilder> methodInfo;
    2889     failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, MethodMode, false, ConstructorKind::None, SuperBinding::NotNeeded, methodStart, methodInfo, StandardFunctionParseType)), "Cannot parse this method");
     2891    failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SourceParseMode::MethodMode, false, ConstructorKind::None, SuperBinding::NotNeeded, methodStart, methodInfo, StandardFunctionParseType)), "Cannot parse this method");
    28902892    methodInfo.name = methodName;
    28912893    return context.createFunctionExpr(methodLocation, methodInfo);
     
    29132915    if (type & PropertyNode::Getter) {
    29142916        failIfFalse(match(OPENPAREN), "Expected a parameter list for getter definition");
    2915         failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, GetterMode, false, constructorKind, superBinding,
     2917        failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SourceParseMode::GetterMode, false, constructorKind, superBinding,
    29162918            getterOrSetterStartOffset, info, StandardFunctionParseType)), "Cannot parse getter definition");
    29172919    } else {
    29182920        failIfFalse(match(OPENPAREN), "Expected a parameter list for setter definition");
    2919         failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SetterMode, false, constructorKind, superBinding,
     2921        failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SourceParseMode::SetterMode, false, constructorKind, superBinding,
    29202922            getterOrSetterStartOffset, info, StandardFunctionParseType)), "Cannot parse setter definition");
    29212923    }
     
    31853187        ParserFunctionInfo<TreeBuilder> info;
    31863188        info.name = &m_vm->propertyNames->nullIdentifier;
    3187         failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, NormalFunctionMode, false, ConstructorKind::None, SuperBinding::NotNeeded, functionKeywordStart, info, StandardFunctionParseType)), "Cannot parse function expression");
     3189        failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SourceParseMode::NormalFunctionMode, false, ConstructorKind::None, SuperBinding::NotNeeded, functionKeywordStart, info, StandardFunctionParseType)), "Cannot parse function expression");
    31883190        return context.createFunctionExpr(location, info);
    31893191    }
     
    34573459    ParserFunctionInfo<TreeBuilder> info;
    34583460    info.name = &m_vm->propertyNames->nullIdentifier;
    3459     failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, ArrowFunctionMode, true, ConstructorKind::None, SuperBinding::NotNeeded, functionKeywordStart, info, ArrowFunctionParseType)), "Cannot parse arrow function expression");
     3461    failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SourceParseMode::ArrowFunctionMode, true, ConstructorKind::None, SuperBinding::NotNeeded, functionKeywordStart, info, ArrowFunctionParseType)), "Cannot parse arrow function expression");
    34603462
    34613463    return context.createArrowFunctionExpr(location, info);
Note: See TracChangeset for help on using the changeset viewer.