summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/parser/NodeConstructors.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/parser/NodeConstructors.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/JavaScriptCore/parser/NodeConstructors.h')
-rw-r--r--Source/JavaScriptCore/parser/NodeConstructors.h413
1 files changed, 289 insertions, 124 deletions
diff --git a/Source/JavaScriptCore/parser/NodeConstructors.h b/Source/JavaScriptCore/parser/NodeConstructors.h
index 917126975..da71e8acd 100644
--- a/Source/JavaScriptCore/parser/NodeConstructors.h
+++ b/Source/JavaScriptCore/parser/NodeConstructors.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2009, 2013, 2015-2016 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -18,32 +18,33 @@
*
*/
-#ifndef NodeConstructors_h
-#define NodeConstructors_h
+#pragma once
#include "Nodes.h"
#include "Lexer.h"
+#include "Opcode.h"
#include "Parser.h"
namespace JSC {
- inline void* ParserArenaFreeable::operator new(size_t size, VM* vm)
+ inline void* ParserArenaFreeable::operator new(size_t size, ParserArena& parserArena)
{
- return vm->parserArena->allocateFreeable(size);
+ return parserArena.allocateFreeable(size);
}
- inline void* ParserArenaDeletable::operator new(size_t size, VM* vm)
+ inline void* ParserArenaDeletable::operator new(size_t size, ParserArena& parserArena)
{
- return vm->parserArena->allocateDeletable(size);
+ return parserArena.allocateDeletable(size);
}
- inline ParserArenaRefCounted::ParserArenaRefCounted(VM* vm)
+ inline ParserArenaRoot::ParserArenaRoot(ParserArena& parserArena)
{
- vm->parserArena->derefWithArena(adoptRef(this));
+ m_arena.swap(parserArena);
}
inline Node::Node(const JSTokenLocation& location)
: m_position(location.line, location.startOffset, location.lineStartOffset)
+ , m_endOffset(-1)
{
ASSERT(location.startOffset >= location.lineStartOffset);
}
@@ -56,6 +57,7 @@ namespace JSC {
inline StatementNode::StatementNode(const JSTokenLocation& location)
: Node(location)
+ , m_next(nullptr)
, m_lastLine(-1)
{
}
@@ -82,12 +84,72 @@ namespace JSC {
{
}
+ inline DoubleNode::DoubleNode(const JSTokenLocation& location, double value)
+ : NumberNode(location, value)
+ {
+ }
+
+ inline IntegerNode::IntegerNode(const JSTokenLocation& location, double value)
+ : DoubleNode(location, value)
+ {
+ }
+
inline StringNode::StringNode(const JSTokenLocation& location, const Identifier& value)
: ConstantNode(location, ResultType::stringType())
, m_value(value)
{
}
+ inline TemplateExpressionListNode::TemplateExpressionListNode(ExpressionNode* node)
+ : m_node(node)
+ {
+ }
+
+ inline TemplateExpressionListNode::TemplateExpressionListNode(TemplateExpressionListNode* previous, ExpressionNode* node)
+ : m_node(node)
+ {
+ previous->m_next = this;
+ }
+
+ inline TemplateStringNode::TemplateStringNode(const JSTokenLocation& location, const Identifier* cooked, const Identifier* raw)
+ : ExpressionNode(location)
+ , m_cooked(cooked)
+ , m_raw(raw)
+ {
+ }
+
+ inline TemplateStringListNode::TemplateStringListNode(TemplateStringNode* node)
+ : m_node(node)
+ {
+ }
+
+ inline TemplateStringListNode::TemplateStringListNode(TemplateStringListNode* previous, TemplateStringNode* node)
+ : m_node(node)
+ {
+ previous->m_next = this;
+ }
+
+ inline TemplateLiteralNode::TemplateLiteralNode(const JSTokenLocation& location, TemplateStringListNode* templateStrings)
+ : ExpressionNode(location)
+ , m_templateStrings(templateStrings)
+ , m_templateExpressions(nullptr)
+ {
+ }
+
+ inline TemplateLiteralNode::TemplateLiteralNode(const JSTokenLocation& location, TemplateStringListNode* templateStrings, TemplateExpressionListNode* templateExpressions)
+ : ExpressionNode(location)
+ , m_templateStrings(templateStrings)
+ , m_templateExpressions(templateExpressions)
+ {
+ }
+
+ inline TaggedTemplateNode::TaggedTemplateNode(const JSTokenLocation& location, ExpressionNode* tag, TemplateLiteralNode* templateLiteral)
+ : ExpressionNode(location)
+ , m_tag(tag)
+ , m_templateLiteral(templateLiteral)
+ {
+ }
+
inline RegExpNode::RegExpNode(const JSTokenLocation& location, const Identifier& pattern, const Identifier& flags)
: ExpressionNode(location)
, m_pattern(pattern)
@@ -100,7 +162,23 @@ namespace JSC {
{
}
-inline ResolveNode::ResolveNode(const JSTokenLocation& location, const Identifier& ident, const JSTextPosition& start)
+ inline SuperNode::SuperNode(const JSTokenLocation& location)
+ : ExpressionNode(location)
+ {
+ }
+
+ inline ImportNode::ImportNode(const JSTokenLocation& location, ExpressionNode* expr)
+ : ExpressionNode(location)
+ , m_expr(expr)
+ {
+ }
+
+ inline NewTargetNode::NewTargetNode(const JSTokenLocation& location)
+ : ExpressionNode(location)
+ {
+ }
+
+ inline ResolveNode::ResolveNode(const JSTokenLocation& location, const Identifier& ident, const JSTextPosition& start)
: ExpressionNode(location)
, m_ident(ident)
, m_start(start)
@@ -147,25 +225,24 @@ inline ResolveNode::ResolveNode(const JSTokenLocation& location, const Identifie
{
}
- inline PropertyNode::PropertyNode(VM*, const Identifier& name, ExpressionNode* assign, Type type)
+ inline PropertyNode::PropertyNode(const Identifier& name, ExpressionNode* assign, Type type, PutType putType, SuperBinding superBinding, bool isClassProperty)
: m_name(&name)
, m_assign(assign)
, m_type(type)
+ , m_needsSuperBinding(superBinding == SuperBinding::Needed)
+ , m_putType(putType)
+ , m_isClassProperty(isClassProperty)
{
}
- inline PropertyNode::PropertyNode(VM* vm, double name, ExpressionNode* assign, Type type)
- : m_name(&vm->parserArena->identifierArena().makeNumericIdentifier(vm, name))
- , m_assign(assign)
- , m_type(type)
- {
- }
-
- inline PropertyNode::PropertyNode(VM*, ExpressionNode* name, ExpressionNode* assign, Type type)
+ inline PropertyNode::PropertyNode(ExpressionNode* name, ExpressionNode* assign, Type type, PutType putType, SuperBinding superBinding, bool isClassProperty)
: m_name(0)
, m_expression(name)
, m_assign(assign)
, m_type(type)
+ , m_needsSuperBinding(superBinding == SuperBinding::Needed)
+ , m_putType(putType)
+ , m_isClassProperty(isClassProperty)
{
}
@@ -281,12 +358,13 @@ inline ResolveNode::ResolveNode(const JSTokenLocation& location, const Identifie
{
}
- inline FunctionCallBracketNode::FunctionCallBracketNode(const JSTokenLocation& location, ExpressionNode* base, ExpressionNode* subscript, ArgumentsNode* args, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd)
+ inline FunctionCallBracketNode::FunctionCallBracketNode(const JSTokenLocation& location, ExpressionNode* base, ExpressionNode* subscript, bool subscriptHasAssignments, ArgumentsNode* args, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd)
: ExpressionNode(location)
, ThrowableSubExpressionData(divot, divotStart, divotEnd)
, m_base(base)
, m_subscript(subscript)
, m_args(args)
+ , m_subscriptHasAssignments(subscriptHasAssignments)
{
}
@@ -299,6 +377,16 @@ inline ResolveNode::ResolveNode(const JSTokenLocation& location, const Identifie
{
}
+ inline BytecodeIntrinsicNode::BytecodeIntrinsicNode(Type type, const JSTokenLocation& location, EmitterType emitter, const Identifier& ident, ArgumentsNode* args, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd)
+ : ExpressionNode(location)
+ , ThrowableExpressionData(divot, divotStart, divotEnd)
+ , m_type(type)
+ , m_emitter(emitter)
+ , m_ident(ident)
+ , m_args(args)
+ {
+ }
+
inline CallFunctionCallDotNode::CallFunctionCallDotNode(const JSTokenLocation& location, ExpressionNode* base, const Identifier& ident, ArgumentsNode* args, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd)
: FunctionCallDotNode(location, base, ident, args, divot, divotStart, divotEnd)
{
@@ -415,6 +503,11 @@ inline ResolveNode::ResolveNode(const JSTokenLocation& location, const Identifie
{
}
+ inline PowNode::PowNode(const JSTokenLocation& location, ExpressionNode* expr1, ExpressionNode* expr2, bool rightHasAssignments)
+ : BinaryOpNode(location, ResultType::numberType(), expr1, expr2, op_pow, rightHasAssignments)
+ {
+ }
+
inline MultNode::MultNode(const JSTokenLocation& location, ExpressionNode* expr1, ExpressionNode* expr2, bool rightHasAssignments)
: BinaryOpNode(location, ResultType::numberType(), expr1, expr2, op_mul, rightHasAssignments)
{
@@ -557,10 +650,11 @@ inline ResolveNode::ResolveNode(const JSTokenLocation& location, const Identifie
{
}
- inline AssignResolveNode::AssignResolveNode(const JSTokenLocation& location, const Identifier& ident, ExpressionNode* right)
+ inline AssignResolveNode::AssignResolveNode(const JSTokenLocation& location, const Identifier& ident, ExpressionNode* right, AssignmentContext assignmentContext)
: ExpressionNode(location)
, m_ident(ident)
, m_right(right)
+ , m_assignmentContext(assignmentContext)
{
}
@@ -615,22 +709,16 @@ inline ResolveNode::ResolveNode(const JSTokenLocation& location, const Identifie
{
}
- inline CommaNode::CommaNode(const JSTokenLocation& location, ExpressionNode* expr1, ExpressionNode* expr2)
+ inline CommaNode::CommaNode(const JSTokenLocation& location, ExpressionNode* expr)
: ExpressionNode(location)
- {
- ASSERT(expr1);
- ASSERT(expr2);
- m_expressions.append(expr1);
- m_expressions.append(expr2);
- }
-
- inline ConstStatementNode::ConstStatementNode(const JSTokenLocation& location, ConstDeclNode* next)
- : StatementNode(location)
- , m_next(next)
+ , m_expr(expr)
+ , m_next(nullptr)
{
}
inline SourceElements::SourceElements()
+ : m_head(nullptr)
+ , m_tail(nullptr)
{
}
@@ -650,11 +738,81 @@ inline ResolveNode::ResolveNode(const JSTokenLocation& location, const Identifie
{
}
- inline VarStatementNode::VarStatementNode(const JSTokenLocation& location, ExpressionNode* expr)
+ inline DeclarationStatement::DeclarationStatement(const JSTokenLocation& location, ExpressionNode* expr)
: StatementNode(location)
, m_expr(expr)
{
}
+
+ inline ModuleDeclarationNode::ModuleDeclarationNode(const JSTokenLocation& location)
+ : StatementNode(location)
+ {
+ }
+
+ inline ModuleNameNode::ModuleNameNode(const JSTokenLocation& location, const Identifier& moduleName)
+ : Node(location)
+ , m_moduleName(moduleName)
+ {
+ }
+
+ inline ImportSpecifierNode::ImportSpecifierNode(const JSTokenLocation& location, const Identifier& importedName, const Identifier& localName)
+ : Node(location)
+ , m_importedName(importedName)
+ , m_localName(localName)
+ {
+ }
+
+ inline ImportDeclarationNode::ImportDeclarationNode(const JSTokenLocation& location, ImportSpecifierListNode* importSpecifierList, ModuleNameNode* moduleName)
+ : ModuleDeclarationNode(location)
+ , m_specifierList(importSpecifierList)
+ , m_moduleName(moduleName)
+ {
+ }
+
+ inline ExportAllDeclarationNode::ExportAllDeclarationNode(const JSTokenLocation& location, ModuleNameNode* moduleName)
+ : ModuleDeclarationNode(location)
+ , m_moduleName(moduleName)
+ {
+ }
+
+ inline ExportDefaultDeclarationNode::ExportDefaultDeclarationNode(const JSTokenLocation& location, StatementNode* declaration, const Identifier& localName)
+ : ModuleDeclarationNode(location)
+ , m_declaration(declaration)
+ , m_localName(localName)
+ {
+ }
+
+ inline ExportLocalDeclarationNode::ExportLocalDeclarationNode(const JSTokenLocation& location, StatementNode* declaration)
+ : ModuleDeclarationNode(location)
+ , m_declaration(declaration)
+ {
+ }
+
+ inline ExportNamedDeclarationNode::ExportNamedDeclarationNode(const JSTokenLocation& location, ExportSpecifierListNode* exportSpecifierList, ModuleNameNode* moduleName)
+ : ModuleDeclarationNode(location)
+ , m_specifierList(exportSpecifierList)
+ , m_moduleName(moduleName)
+ {
+ }
+
+ inline ExportSpecifierNode::ExportSpecifierNode(const JSTokenLocation& location, const Identifier& localName, const Identifier& exportedName)
+ : Node(location)
+ , m_localName(localName)
+ , m_exportedName(exportedName)
+ {
+ }
+
+ inline EmptyVarExpression::EmptyVarExpression(const JSTokenLocation& location, const Identifier& ident)
+ : ExpressionNode(location)
+ , m_ident(ident)
+ {
+ }
+
+ inline EmptyLetExpression::EmptyLetExpression(const JSTokenLocation& location, const Identifier& ident)
+ : ExpressionNode(location)
+ , m_ident(ident)
+ {
+ }
inline IfElseNode::IfElseNode(const JSTokenLocation& location, ExpressionNode* condition, StatementNode* ifBlock, StatementNode* elseBlock)
: StatementNode(location)
@@ -678,8 +836,9 @@ inline ResolveNode::ResolveNode(const JSTokenLocation& location, const Identifie
{
}
- inline ForNode::ForNode(const JSTokenLocation& location, ExpressionNode* expr1, ExpressionNode* expr2, ExpressionNode* expr3, StatementNode* statement)
+ inline ForNode::ForNode(const JSTokenLocation& location, ExpressionNode* expr1, ExpressionNode* expr2, ExpressionNode* expr3, StatementNode* statement, VariableEnvironment& lexicalVariables)
: StatementNode(location)
+ , VariableEnvironmentNode(lexicalVariables)
, m_expr1(expr1)
, m_expr2(expr2)
, m_expr3(expr3)
@@ -688,24 +847,12 @@ inline ResolveNode::ResolveNode(const JSTokenLocation& location, const Identifie
ASSERT(statement);
}
- inline ContinueNode::ContinueNode(VM* vm, const JSTokenLocation& location)
- : StatementNode(location)
- , m_ident(vm->propertyNames->nullIdentifier)
- {
- }
-
inline ContinueNode::ContinueNode(const JSTokenLocation& location, const Identifier& ident)
: StatementNode(location)
, m_ident(ident)
{
}
- inline BreakNode::BreakNode(VM* vm, const JSTokenLocation& location)
- : StatementNode(location)
- , m_ident(vm->propertyNames->nullIdentifier)
- {
- }
-
inline BreakNode::BreakNode(const JSTokenLocation& location, const Identifier& ident)
: StatementNode(location)
, m_ident(ident)
@@ -740,43 +887,85 @@ inline ResolveNode::ResolveNode(const JSTokenLocation& location, const Identifie
{
}
- inline TryNode::TryNode(const JSTokenLocation& location, StatementNode* tryBlock, const Identifier& exceptionIdent, StatementNode* catchBlock, StatementNode* finallyBlock)
+ inline TryNode::TryNode(const JSTokenLocation& location, StatementNode* tryBlock, DestructuringPatternNode* catchPattern, StatementNode* catchBlock, VariableEnvironment& catchEnvironment, StatementNode* finallyBlock)
: StatementNode(location)
+ , VariableEnvironmentNode(catchEnvironment)
, m_tryBlock(tryBlock)
- , m_exceptionIdent(exceptionIdent)
+ , m_catchPattern(catchPattern)
, m_catchBlock(catchBlock)
, m_finallyBlock(finallyBlock)
{
}
- inline ParameterNode::ParameterNode(PassRefPtr<DeconstructionPatternNode> pattern)
- : m_pattern(pattern)
- , m_next(0)
+ inline FunctionParameters::FunctionParameters()
{
- ASSERT(m_pattern);
}
- inline ParameterNode::ParameterNode(ParameterNode* l, PassRefPtr<DeconstructionPatternNode> pattern)
- : m_pattern(pattern)
- , m_next(0)
+
+ inline BaseFuncExprNode::BaseFuncExprNode(const JSTokenLocation& location, const Identifier& ident, FunctionMetadataNode* metadata, const SourceCode& source, FunctionMode functionMode)
+ : ExpressionNode(location)
+ , m_metadata(metadata)
+ {
+ m_metadata->finishParsing(source, ident, functionMode);
+ }
+
+ inline FuncExprNode::FuncExprNode(const JSTokenLocation& location, const Identifier& ident, FunctionMetadataNode* metadata, const SourceCode& source)
+ : BaseFuncExprNode(location, ident, metadata, source, FunctionMode::FunctionExpression)
{
- l->m_next = this;
- ASSERT(m_pattern);
- ASSERT(l->m_pattern);
}
- inline FuncExprNode::FuncExprNode(const JSTokenLocation& location, const Identifier& ident, FunctionBodyNode* body, const SourceCode& source, ParameterNode* parameter)
+ inline FuncExprNode::FuncExprNode(const JSTokenLocation& location, const Identifier& ident, FunctionMetadataNode* metadata, const SourceCode& source, FunctionMode functionMode)
+ : BaseFuncExprNode(location, ident, metadata, source, functionMode)
+ {
+ }
+
+ inline FuncDeclNode::FuncDeclNode(const JSTokenLocation& location, const Identifier& ident, FunctionMetadataNode* metadata, const SourceCode& source)
+ : StatementNode(location)
+ , m_metadata(metadata)
+ {
+ m_metadata->finishParsing(source, ident, FunctionMode::FunctionDeclaration);
+ }
+
+ inline ArrowFuncExprNode::ArrowFuncExprNode(const JSTokenLocation& location, const Identifier& ident, FunctionMetadataNode* metadata, const SourceCode& source)
+ : BaseFuncExprNode(location, ident, metadata, source, FunctionMode::FunctionExpression)
+ {
+ }
+
+ inline MethodDefinitionNode::MethodDefinitionNode(const JSTokenLocation& location, const Identifier& ident, FunctionMetadataNode* metadata, const SourceCode& source)
+ : FuncExprNode(location, ident, metadata, source, FunctionMode::MethodDefinition)
+ {
+ }
+
+ inline YieldExprNode::YieldExprNode(const JSTokenLocation& location, ExpressionNode* argument, bool delegate)
+ : ExpressionNode(location)
+ , m_argument(argument)
+ , m_delegate(delegate)
+ {
+ }
+
+ inline AwaitExprNode::AwaitExprNode(const JSTokenLocation& location, ExpressionNode* argument)
: ExpressionNode(location)
- , m_body(body)
+ , m_argument(argument)
{
- m_body->finishParsing(source, parameter, ident, FunctionNameIsInScope);
}
- inline FuncDeclNode::FuncDeclNode(const JSTokenLocation& location, const Identifier& ident, FunctionBodyNode* body, const SourceCode& source, ParameterNode* parameter)
+ inline ClassDeclNode::ClassDeclNode(const JSTokenLocation& location, ExpressionNode* classDeclaration)
: StatementNode(location)
- , m_body(body)
+ , m_classDeclaration(classDeclaration)
+ {
+ }
+
+ inline ClassExprNode::ClassExprNode(const JSTokenLocation& location, const Identifier& name, const SourceCode& classSource, VariableEnvironment& classEnvironment, ExpressionNode* constructorExpression, ExpressionNode* classHeritage, PropertyListNode* instanceMethods, PropertyListNode* staticMethods)
+ : ExpressionNode(location)
+ , VariableEnvironmentNode(classEnvironment)
+ , m_classSource(classSource)
+ , m_name(name)
+ , m_ecmaName(&name)
+ , m_constructorExpression(constructorExpression)
+ , m_classHeritage(classHeritage)
+ , m_instanceMethods(instanceMethods)
+ , m_staticMethods(staticMethods)
{
- m_body->finishParsing(source, parameter, ident, FunctionNameIsNotInScope);
}
inline CaseClauseNode::CaseClauseNode(ExpressionNode* expr, SourceElements* statements)
@@ -805,103 +994,81 @@ inline ResolveNode::ResolveNode(const JSTokenLocation& location, const Identifie
{
}
- inline SwitchNode::SwitchNode(const JSTokenLocation& location, ExpressionNode* expr, CaseBlockNode* block)
+ inline SwitchNode::SwitchNode(const JSTokenLocation& location, ExpressionNode* expr, CaseBlockNode* block, VariableEnvironment& lexicalVariables, FunctionStack&& functionStack)
: StatementNode(location)
+ , VariableEnvironmentNode(lexicalVariables, WTFMove(functionStack))
, m_expr(expr)
, m_block(block)
{
}
- inline ConstDeclNode::ConstDeclNode(const JSTokenLocation& location, const Identifier& ident, ExpressionNode* init)
- : ExpressionNode(location)
- , m_ident(ident)
- , m_next(0)
- , m_init(init)
- {
- }
-
- inline BlockNode::BlockNode(const JSTokenLocation& location, SourceElements* statements)
+ inline BlockNode::BlockNode(const JSTokenLocation& location, SourceElements* statements, VariableEnvironment& lexicalVariables, FunctionStack&& functionStack)
: StatementNode(location)
+ , VariableEnvironmentNode(lexicalVariables, WTFMove(functionStack))
, m_statements(statements)
{
}
- inline EnumerationNode::EnumerationNode(const JSTokenLocation& location, ExpressionNode* l, ExpressionNode* expr, StatementNode* statement)
+ inline EnumerationNode::EnumerationNode(const JSTokenLocation& location, ExpressionNode* lexpr, ExpressionNode* expr, StatementNode* statement, VariableEnvironment& lexicalVariables)
: StatementNode(location)
- , m_lexpr(l)
+ , VariableEnvironmentNode(lexicalVariables)
+ , m_lexpr(lexpr)
, m_expr(expr)
, m_statement(statement)
{
- ASSERT(l);
+ ASSERT(lexpr);
}
- inline EnumerationNode::EnumerationNode(VM* vm, const JSTokenLocation& location, DeconstructionPatternNode* pattern, ExpressionNode* expr, StatementNode* statement)
- : StatementNode(location)
- , m_lexpr(new (vm) DeconstructingAssignmentNode(location, pattern, 0))
- , m_expr(expr)
- , m_statement(statement)
+ inline ForInNode::ForInNode(const JSTokenLocation& location, ExpressionNode* lexpr, ExpressionNode* expr, StatementNode* statement, VariableEnvironment& lexicalVariables)
+ : EnumerationNode(location, lexpr, expr, statement, lexicalVariables)
{
- ASSERT(pattern);
}
- inline ForInNode::ForInNode(const JSTokenLocation& location, ExpressionNode* l, ExpressionNode* expr, StatementNode* statement)
- : EnumerationNode(location, l, expr, statement)
+ inline ForOfNode::ForOfNode(const JSTokenLocation& location, ExpressionNode* lexpr, ExpressionNode* expr, StatementNode* statement, VariableEnvironment& lexicalVariables)
+ : EnumerationNode(location, lexpr, expr, statement, lexicalVariables)
{
}
- inline ForInNode::ForInNode(VM* vm, const JSTokenLocation& location, DeconstructionPatternNode* pattern, ExpressionNode* expr, StatementNode* statement)
- : EnumerationNode(vm, location, pattern, expr, statement)
- {
- }
-
- inline ForOfNode::ForOfNode(const JSTokenLocation& location, ExpressionNode* l, ExpressionNode* expr, StatementNode* statement)
- : EnumerationNode(location, l, expr, statement)
- {
- }
-
- inline ForOfNode::ForOfNode(VM* vm, const JSTokenLocation& location, DeconstructionPatternNode* pattern, ExpressionNode* expr, StatementNode* statement)
- : EnumerationNode(vm, location, pattern, expr, statement)
- {
- }
-
- inline DeconstructionPatternNode::DeconstructionPatternNode(VM*)
+ inline DestructuringPatternNode::DestructuringPatternNode()
{
}
- inline ArrayPatternNode::ArrayPatternNode(VM* vm)
- : DeconstructionPatternNode(vm)
+ inline ArrayPatternNode::ArrayPatternNode()
+ : DestructuringPatternNode()
{
}
- inline PassRefPtr<ArrayPatternNode> ArrayPatternNode::create(VM* vm)
+ inline ObjectPatternNode::ObjectPatternNode()
+ : DestructuringPatternNode()
{
- return adoptRef(new ArrayPatternNode(vm));
}
- inline ObjectPatternNode::ObjectPatternNode(VM* vm)
- : DeconstructionPatternNode(vm)
- {
- }
-
- inline PassRefPtr<ObjectPatternNode> ObjectPatternNode::create(VM* vm)
+ inline BindingNode::BindingNode(const Identifier& boundProperty, const JSTextPosition& start, const JSTextPosition& end, AssignmentContext context)
+ : DestructuringPatternNode()
+ , m_divotStart(start)
+ , m_divotEnd(end)
+ , m_boundProperty(boundProperty)
+ , m_bindingContext(context)
{
- return adoptRef(new ObjectPatternNode(vm));
}
- inline PassRefPtr<BindingNode> BindingNode::create(VM* vm, const Identifier& boundProperty, const JSTextPosition& start, const JSTextPosition& end)
- {
- return adoptRef(new BindingNode(vm, boundProperty, start, end));
- }
-
- inline BindingNode::BindingNode(VM* vm, const Identifier& boundProperty, const JSTextPosition& start, const JSTextPosition& end)
- : DeconstructionPatternNode(vm)
+ inline AssignmentElementNode::AssignmentElementNode(ExpressionNode* assignmentTarget, const JSTextPosition& start, const JSTextPosition& end)
+ : DestructuringPatternNode()
, m_divotStart(start)
, m_divotEnd(end)
- , m_boundProperty(boundProperty)
+ , m_assignmentTarget(assignmentTarget)
{
}
-
- inline DeconstructingAssignmentNode::DeconstructingAssignmentNode(const JSTokenLocation& location, PassRefPtr<DeconstructionPatternNode> bindings, ExpressionNode* initializer)
+
+ inline RestParameterNode::RestParameterNode(DestructuringPatternNode* pattern, unsigned numParametersToSkip)
+ : DestructuringPatternNode()
+ , m_pattern(pattern)
+ , m_numParametersToSkip(numParametersToSkip)
+ {
+ ASSERT(!pattern->isRestParameter());
+ }
+
+ inline DestructuringAssignmentNode::DestructuringAssignmentNode(const JSTokenLocation& location, DestructuringPatternNode* bindings, ExpressionNode* initializer)
: ExpressionNode(location)
, m_bindings(bindings)
, m_initializer(initializer)
@@ -909,5 +1076,3 @@ inline ResolveNode::ResolveNode(const JSTokenLocation& location, const Identifie
}
} // namespace JSC
-
-#endif // NodeConstructors_h