C# Class Rhino.Ast.ObjectLiteral

AST node for an Object literal (also called an Object initialiser in Ecma-262).
AST node for an Object literal (also called an Object initialiser in Ecma-262). The elements list will always be non- null , although the list will have no elements if the Object literal is empty.

Node type is Rhino.Token.OBJECTLIT .

ObjectLiteral : {} { PropertyNameAndValueList } PropertyNameAndValueList : PropertyName : AssignmentExpression PropertyNameAndValueList , PropertyName : AssignmentExpression PropertyName : Identifier StringLiteral NumericLiteral
Inheritance: AstNode, DestructuringForm
Mostrar archivo Open project: hazzik/Rhino.Net Class Usage Examples

Public Methods

Method Description
AddElement ( ObjectProperty element ) : void

Adds an element to the list, and sets its parent to this node.

Adds an element to the list, and sets its parent to this node.

GetElements ( ) : IList

Returns the element list.

Returns the element list. Returns an immutable empty list if there are no elements.

IsDestructuring ( ) : bool

Returns true if this node is in a destructuring position: a function parameter, the target of a variable initializer, the iterator of a for..in loop, etc.

Returns true if this node is in a destructuring position: a function parameter, the target of a variable initializer, the iterator of a for..in loop, etc.

ObjectLiteral ( ) : System.Collections.Generic
ObjectLiteral ( int pos ) : System.Collections.Generic
ObjectLiteral ( int pos, int len ) : System.Collections.Generic
SetElements ( IList elements ) : void

Sets the element list, and updates the parent of each element.

Sets the element list, and updates the parent of each element. Replaces any existing elements.

SetIsDestructuring ( bool destructuring ) : void

Marks this node as being a destructuring form - that is, appearing in a context such as for ([a, b] in ...) where it's the target of a destructuring assignment.

ToSource ( int depth ) : string
Visit ( NodeVisitor v ) : void

Visits this node, then visits each child property node, in lexical (source) order.

Visits this node, then visits each child property node, in lexical (source) order.

Method Details

AddElement() public method

Adds an element to the list, and sets its parent to this node.
Adds an element to the list, and sets its parent to this node.
/// } if element is /// null ///
public AddElement ( ObjectProperty element ) : void
element ObjectProperty the property node to append to the end of the list
return void

GetElements() public method

Returns the element list.
Returns the element list. Returns an immutable empty list if there are no elements.
public GetElements ( ) : IList
return IList

IsDestructuring() public method

Returns true if this node is in a destructuring position: a function parameter, the target of a variable initializer, the iterator of a for..in loop, etc.
Returns true if this node is in a destructuring position: a function parameter, the target of a variable initializer, the iterator of a for..in loop, etc.
public IsDestructuring ( ) : bool
return bool

ObjectLiteral() public method

public ObjectLiteral ( ) : System.Collections.Generic
return System.Collections.Generic

ObjectLiteral() public method

public ObjectLiteral ( int pos ) : System.Collections.Generic
pos int
return System.Collections.Generic

ObjectLiteral() public method

public ObjectLiteral ( int pos, int len ) : System.Collections.Generic
pos int
len int
return System.Collections.Generic

SetElements() public method

Sets the element list, and updates the parent of each element.
Sets the element list, and updates the parent of each element. Replaces any existing elements.
public SetElements ( IList elements ) : void
elements IList /// the element list. Can be /// null /// . ///
return void

SetIsDestructuring() public method

Marks this node as being a destructuring form - that is, appearing in a context such as for ([a, b] in ...) where it's the target of a destructuring assignment.
public SetIsDestructuring ( bool destructuring ) : void
destructuring bool
return void

ToSource() public method

public ToSource ( int depth ) : string
depth int
return string

Visit() public method

Visits this node, then visits each child property node, in lexical (source) order.
Visits this node, then visits each child property node, in lexical (source) order.
public Visit ( NodeVisitor v ) : void
v NodeVisitor
return void