module RubyRunJs::JsBooleanMethods

Public Class Methods

constructor(builtin, this, value) click to toggle source
# File lib/ruby_run_js/object_methods/js_boolean.rb, line 8
def constructor(builtin, this, value)
  to_boolean(value)
end
constructor_new(builtin, this, value) click to toggle source
# File lib/ruby_run_js/object_methods/js_boolean.rb, line 12
def constructor_new(builtin, this, value)
  builtin.new_boolean(value)
end
prototype_toString(builtin, this) click to toggle source
# File lib/ruby_run_js/object_methods/js_boolean.rb, line 16
def prototype_toString(builtin, this)
  if this.js_class != 'Boolean'
    raise make_error('TypeError', 'Boolean.prototype.toString is not generic')
  end
  if this.js_type == :Object
    this = this.value
  end
  this ? 'true' : 'false'
end
prototype_valueOf(builtin, this) click to toggle source
# File lib/ruby_run_js/object_methods/js_boolean.rb, line 26
def prototype_valueOf(builtin, this)
  if this.js_class != 'Boolean'
    raise make_error('TypeError', 'Boolean.prototype.valueOf is not generic')
  end
  if this.js_type == :Object
    this = this.value
  end
  this
end