Class: Minjs::ECMA262::WhiteSpace

Inherits:
Literal show all
Defined in:
lib/minjs/ecma262/literal.rb

Overview

Class of ECMA262 WhiteSpace element

Every WhiteSpace characters in source elements is converted to this class object.

This class is singleton and representation string is u0020.

See Also:

Constant Summary collapse

@@instance =
self.new()

Instance Attribute Summary

Attributes inherited from Base

#parent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Literal

#lt?, #priority, #side_effect?

Methods inherited from Base

#add_remove_paren, #concat, #deep_dup, #replace

Class Method Details

.getObject

get instance



92
93
94
# File 'lib/minjs/ecma262/literal.rb', line 92

def self.get
  @@instance
end

Instance Method Details

#==(obj) ⇒ Object

compare object



79
80
81
# File 'lib/minjs/ecma262/literal.rb', line 79

def ==(obj)
  self.class == obj.class
end

#to_js(options = {}) ⇒ Object

Returns a ECMAScript string containg the representation of element.

See Also:



85
86
87
# File 'lib/minjs/ecma262/literal.rb', line 85

def to_js(options = {})
  " "
end

#traverse(parent, &block) ⇒ Object

Traverses this children and itself with given block.

See Also:



70
71
# File 'lib/minjs/ecma262/literal.rb', line 70

def traverse(parent, &block)
end

#ws?Boolean

true if literal is white space

Returns:



74
75
76
# File 'lib/minjs/ecma262/literal.rb', line 74

def ws?
  true
end