 		super 'EmptyStatement', loc
 
 class ExpressionStatement extends Statement
-	constructor: (expr, loc = null) ->
+	constructor: (@expression, loc = null) ->
 		super 'ExpressionStatement', loc
-		@expression = expr
 		isA @expression, Expression
 
 class ForStatement extends Statement

		isA @body, Statement

class YieldExpression extends Expression
	constructor: (arg, loc = null) ->
		super 'YieldExpression', loc
		@argument = arg
		isNullOr @argument, Expression

Properties =

		isNullOr @value, [ 'string', 'boolean', 'number', RegExp ]

class LogicalExpression extends Expression
	constructor: (@operator, @left, @right, loc = null) ->
		super 'LogicalExpression', loc
		isLiterally @operator, LogicalOperator
		isA @left, Expression
		isA @right, Expression

class MemberExpression extends Expression
	constructor: (@object, @property, isComputed = false, loc = null) ->
		super 'MemberExpression', loc
		@computed = isComputed
		isA @object, Expression
		isOneOf @property, [ Identifier, Expression ]
		isA @computed, 'boolean'

class NewExpression extends Expression
	constructor: (@callee, @arguments = [], loc = null) ->
		super 'NewExpression', loc
		isA @callee, Expression
		isArrayOf @arguments, Expression

class ObjectExpression extends Expression
	constructor: (@properties = [], loc = null) ->
		super 'ObjectExpression', loc
		isArrayOf @properties, Property

class ObjectPattern extends Pattern
	constructor: (@properties = [], loc = null) ->
		super 'ObjectPattern', loc
		isArrayOf @properties, PropertyPattern

class Program extends Node
	constructor: (@body = [], loc = null) ->
		super 'Program', loc
		isArrayOf @body, Statement

class Property extends Node
	constructor: (@key, @value, @kind, loc = null) ->
		super 'Property', loc
		isOneOf @key, [ Literal, Identifier ]
		isA @value, Expression
		isLiterally @kind, [ 'init', 'get', 'set' ]

class PropertyPattern extends Node
	constructor: (@key, @value, loc = null) ->
		super 'PropertyPattern', loc
		isOneOf @key, [ Literal, Identifier ]
		isA @value, Pattern

class ReturnStatement extends Statement
	constructor: (@argument, loc = null) ->
		super 'ReturnStatement', loc
		isNullOr @argument, Expression

class SequenceExpression extends Expression
	constructor: (@expressions, loc = null) ->
		super 'SequenceExpression', loc
		isArrayOf @expressions, Expression

class SpreadExpression extends Expression
	constructor: (@argument, loc = null) ->
		super 'SpreadExpression', loc
		isA @argument, Expression

class SwitchCase extends Node
	constructor: (@test, @consequent = [], loc = null) ->
		super 'SwitchCase', loc
		isNullOr @test, Expression
		isArrayOf @consequent, Statement

class SwitchStatement extends Statement
	constructor: (@discriminant, @cases, isLexical, loc = null) ->
		super 'SwitchStatement', loc
		@lexical = isLexical
		isA @discriminant, Expression
		isArrayOf @cases, SwitchCase
