Exception: Dommy::Bridge::ThrowValue

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/dommy/bridge.rb

Overview

Raised by a host method that must throw an ARBITRARY value back to JS — not a DOMException/Error, but e.g. signal.throwIfAborted() throwing the exact abort reason (a string, number, or opaque JSValue). The bridge re-throws the wrapped value verbatim (identity preserved). Subclasses RuntimeError (with the value's string form as the message) so standalone CRuby callers still see a normal raise-able error.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ ThrowValue

Returns a new instance of ThrowValue.



78
79
80
81
# File 'lib/dommy/bridge.rb', line 78

def initialize(value)
  @value = value
  super(value.to_s)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



76
77
78
# File 'lib/dommy/bridge.rb', line 76

def value
  @value
end