Class: Dommy::ErrorEvent
Overview
ErrorEvent — the event interface for an uncaught error (fired at
window.onerror). Error-reporting code constructs it directly
(new ErrorEvent("error", { message, error, … })); without the constructor
that call is "not a function" and takes the whole app down before it renders
(x.com's client bootstrap does exactly this).
Constant Summary
Constants inherited from Event
Dommy::Event::AT_TARGET, Dommy::Event::BUBBLING_PHASE, Dommy::Event::CAPTURING_PHASE, Dommy::Event::NONE
Instance Attribute Summary collapse
-
#colno ⇒ Object
readonly
Returns the value of attribute colno.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#lineno ⇒ Object
readonly
Returns the value of attribute lineno.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Attributes inherited from Event
Instance Method Summary collapse
- #__js_get__(key) ⇒ Object
-
#initialize(type, init = nil) ⇒ ErrorEvent
constructor
A new instance of ErrorEvent.
Methods inherited from Event
#__internal_clear_propagation_flags__, #__internal_mark_trusted__, #__internal_prepare_for_dispatch__, #__internal_record_path__, #__internal_run_passive__, #__internal_set_current_target__, #__internal_set_dispatch_flag__, #__internal_set_event_phase__, #__js_call__, #__js_set__, #bubbles?, #default_prevented?, #immediate_propagation_stopped?, #init_event, #propagation_stopped?
Methods included from Bridge::Methods
Constructor Details
#initialize(type, init = nil) ⇒ ErrorEvent
Returns a new instance of ErrorEvent.
769 770 771 772 773 774 775 776 |
# File 'lib/dommy/event.rb', line 769 def initialize(type, init = nil) super @message = read_init(init, "message") || "" @filename = read_init(init, "filename") || "" @lineno = read_init(init, "lineno") || 0 @colno = read_init(init, "colno") || 0 @error = read_init(init, "error") end |
Instance Attribute Details
#colno ⇒ Object (readonly)
Returns the value of attribute colno.
767 768 769 |
# File 'lib/dommy/event.rb', line 767 def colno @colno end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
767 768 769 |
# File 'lib/dommy/event.rb', line 767 def error @error end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
767 768 769 |
# File 'lib/dommy/event.rb', line 767 def filename @filename end |
#lineno ⇒ Object (readonly)
Returns the value of attribute lineno.
767 768 769 |
# File 'lib/dommy/event.rb', line 767 def lineno @lineno end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
767 768 769 |
# File 'lib/dommy/event.rb', line 767 def @message end |
Instance Method Details
#__js_get__(key) ⇒ Object
778 779 780 781 782 783 784 785 786 787 |
# File 'lib/dommy/event.rb', line 778 def __js_get__(key) case key when "message" then @message when "filename" then @filename when "lineno" then @lineno when "colno" then @colno when "error" then @error else super end end |