class Minjs::ECMA262::Punctuator

ECMA262 punctuator element

@see www.ecma-international.org/ecma-262 ECMA262 7.7

Attributes

val[R]

Public Class Methods

get(val) click to toggle source

Returns punctuator object representation of string.

@param val [String] punctuator

# File lib/minjs/ecma262/punctuator.rb, line 18
def self.get(val)
  @@sym[val] ||= self.new(val)
end
new(val) click to toggle source
# File lib/minjs/ecma262/punctuator.rb, line 11
def initialize(val)
  @val = val.to_sym
end

Public Instance Methods

==(obj) click to toggle source

Return true if punctuator equals to other.

@param obj other element.

# File lib/minjs/ecma262/punctuator.rb, line 36
def ==(obj)
  self.class == obj.class and self.val == obj.val
end
to_js() click to toggle source

Returns a ECMAScript string containg the representation of element. @see Base#to_js

# File lib/minjs/ecma262/punctuator.rb, line 29
def to_js
  val.to_s
end
to_s() click to toggle source

Returns a string containg the representation of punctuator.

# File lib/minjs/ecma262/punctuator.rb, line 23
def to_s
  val.to_s
end