Line data Source code
1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim:set ts=2 sw=2 sts=2 et cindent: */
3 : /* This Source Code Form is subject to the terms of the Mozilla Public
4 : * License, v. 2.0. If a copy of the MPL was not distributed with this
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 :
7 : /* THIS FILE IS AUTOGENERATED FROM ErrorEvent.webidl BY Codegen.py - DO NOT EDIT */
8 :
9 : #include "ErrorEvent.h"
10 : #include "ErrorEventBinding.h"
11 : #include "EventBinding.h"
12 : #include "js/GCAPI.h"
13 : #include "mozilla/dom/ErrorEvent.h"
14 : #include "mozilla/dom/Nullable.h"
15 : #include "mozilla/dom/PrimitiveConversions.h"
16 :
17 : namespace mozilla {
18 : namespace dom {
19 :
20 :
21 : NS_IMPL_CYCLE_COLLECTION_CLASS(ErrorEvent)
22 :
23 0 : NS_IMPL_ADDREF_INHERITED(ErrorEvent, Event)
24 0 : NS_IMPL_RELEASE_INHERITED(ErrorEvent, Event)
25 :
26 0 : NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(ErrorEvent, Event)
27 0 : NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
28 :
29 0 : NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(ErrorEvent, Event)
30 0 : NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mError)
31 0 : NS_IMPL_CYCLE_COLLECTION_TRACE_END
32 :
33 0 : NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(ErrorEvent, Event)
34 0 : tmp->mError.setUndefined();
35 0 : NS_IMPL_CYCLE_COLLECTION_UNLINK_END
36 :
37 0 : NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(ErrorEvent)
38 0 : NS_INTERFACE_MAP_END_INHERITING(Event)
39 :
40 0 : ErrorEvent::ErrorEvent(mozilla::dom::EventTarget* aOwner)
41 0 : : Event(aOwner, nullptr, nullptr)
42 : {
43 0 : }
44 :
45 0 : ErrorEvent::~ErrorEvent()
46 : {
47 0 : mError = JS::UndefinedValue();
48 0 : mozilla::DropJSObjects(this);
49 0 : }
50 :
51 : void
52 0 : ErrorEvent::GetError(JS::MutableHandle<JS::Value> aRetVal) const
53 : {
54 0 : JS::ExposeValueToActiveJS(mError);
55 0 : aRetVal.set(mError);
56 0 : }
57 :
58 : ErrorEvent*
59 0 : ErrorEvent::AsErrorEvent()
60 : {
61 0 : return this;
62 : }
63 :
64 : JSObject*
65 0 : ErrorEvent::WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
66 : {
67 0 : return ErrorEventBinding::Wrap(aCx, this, aGivenProto);
68 : }
69 :
70 : already_AddRefed<ErrorEvent>
71 0 : ErrorEvent::Constructor(mozilla::dom::EventTarget* aOwner, const nsAString& aType, const ErrorEventInit& aEventInitDict)
72 : {
73 0 : RefPtr<ErrorEvent> e = new ErrorEvent(aOwner);
74 0 : bool trusted = e->Init(aOwner);
75 0 : e->InitEvent(aType, aEventInitDict.mBubbles, aEventInitDict.mCancelable);
76 0 : e->mMessage = aEventInitDict.mMessage;
77 0 : e->mFilename = aEventInitDict.mFilename;
78 0 : e->mLineno = aEventInitDict.mLineno;
79 0 : e->mColno = aEventInitDict.mColno;
80 0 : e->mError = aEventInitDict.mError;
81 0 : e->SetTrusted(trusted);
82 0 : e->SetComposed(aEventInitDict.mComposed);
83 0 : mozilla::HoldJSObjects(e.get());
84 0 : return e.forget();
85 : }
86 :
87 : already_AddRefed<ErrorEvent>
88 0 : ErrorEvent::Constructor(const GlobalObject& aGlobal, const nsAString& aType, const ErrorEventInit& aEventInitDict, ErrorResult& aRv)
89 : {
90 0 : nsCOMPtr<mozilla::dom::EventTarget> owner = do_QueryInterface(aGlobal.GetAsSupports());
91 0 : return Constructor(owner, aType, aEventInitDict);
92 : }
93 :
94 : void
95 0 : ErrorEvent::GetMessage(nsString& aRetVal) const
96 : {
97 0 : aRetVal = mMessage;
98 0 : }
99 :
100 : void
101 0 : ErrorEvent::GetFilename(nsString& aRetVal) const
102 : {
103 0 : aRetVal = mFilename;
104 0 : }
105 :
106 : uint32_t
107 0 : ErrorEvent::Lineno() const
108 : {
109 0 : return mLineno;
110 : }
111 :
112 : uint32_t
113 0 : ErrorEvent::Colno() const
114 : {
115 0 : return mColno;
116 : }
117 :
118 : void
119 0 : ErrorEvent::GetError(JSContext* cx, JS::MutableHandle<JS::Value> aRetVal) const
120 : {
121 0 : GetError(aRetVal);
122 0 : }
123 :
124 :
125 : } // namespace dom
126 : } // namespace mozilla
|