Ignore:
Timestamp:
Nov 8, 2015, 5:34:09 PM (10 years ago)
Author:
Yusuke Suzuki
Message:

[ES6] Minimize ES6_CLASS_SYNTAX ifdefs
https://bugs.webkit.org/show_bug.cgi?id=151006

Reviewed by Darin Adler.

This patch minimizes ENABLE_ES6_CLASS_SYNTAX ifdefs.
It keeps several ENABLE_ES6_CLASS_SYNTAX ifdefs in Parser.cpp.

  • super meta property
  • class declaration parsing
  • class expression parsing
  • class with import declaration

This change makes difference minimal between the enabled and disabled configurations;
reducing accidental build breaks of the disabled configuration.

  • bytecompiler/BytecodeGenerator.h:

(JSC::BytecodeGenerator::constructorKind): Deleted.

  • bytecompiler/NodesCodegen.cpp:
  • parser/ASTBuilder.h:
  • parser/NodeConstructors.h:
  • parser/Nodes.h:
  • parser/Parser.cpp:
  • parser/Parser.h:

(JSC::Scope::hasDirectSuper): Deleted.
(JSC::Scope::needsSuperBinding): Deleted.

  • parser/ParserFunctionInfo.h:
  • parser/ParserTokens.h:
  • parser/SyntaxChecker.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/SyntaxChecker.h

    r192141 r192147  
    123123    typedef int FormalParameterList;
    124124    typedef int FunctionBody;
    125 #if ENABLE(ES6_CLASS_SYNTAX)
    126125    typedef int ClassExpression;
    127 #endif
    128126    typedef int ModuleName;
    129127    typedef int ImportSpecifier;
     
    183181    ExpressionType createYield(const JSTokenLocation&) { return YieldExpr; }
    184182    ExpressionType createYield(const JSTokenLocation&, ExpressionType, bool) { return YieldExpr; }
    185 #if ENABLE(ES6_CLASS_SYNTAX)
    186183    ClassExpression createClassExpr(const JSTokenLocation&, const Identifier&, VariableEnvironment&, ExpressionType, ExpressionType, PropertyList, PropertyList) { return ClassExpr; }
    187 #endif
    188184    ExpressionType createFunctionExpr(const JSTokenLocation&, const ParserFunctionInfo<SyntaxChecker>&) { return FunctionExpr; }
    189185    int createFunctionMetadata(const JSTokenLocation&, const JSTokenLocation&, int, int, bool, int, int, int, ConstructorKind, unsigned, SourceParseMode, bool, bool) { return FunctionBodyResult; }
     
    231227    int createClauseList(int, int) { return ClauseListResult; }
    232228    int createFuncDeclStatement(const JSTokenLocation&, const ParserFunctionInfo<SyntaxChecker>&) { return StatementResult; }
    233 #if ENABLE(ES6_CLASS_SYNTAX)
    234229    int createClassDeclStatement(const JSTokenLocation&, ClassExpression,
    235230        const JSTextPosition&, const JSTextPosition&, int, int) { return StatementResult; }
    236 #endif
    237231    int createBlockStatement(const JSTokenLocation&, int, int, int, VariableEnvironment&) { return StatementResult; }
    238232    int createExprStatement(const JSTokenLocation&, int, int, int) { return StatementResult; }
Note: See TracChangeset for help on using the changeset viewer.