Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dom/bindings/ErrorEvent.cpp
Line
Count
Source (jump to first uncovered line)
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
NS_IMPL_ADDREF_INHERITED(ErrorEvent, Event)
24
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(ErrorEvent)
38
0
NS_INTERFACE_MAP_END_INHERITING(Event)
39
40
ErrorEvent::ErrorEvent(mozilla::dom::EventTarget* aOwner)
41
  : Event(aOwner, nullptr, nullptr)
42
0
{
43
0
}
44
45
ErrorEvent::~ErrorEvent()
46
0
{
47
0
  mError = JS::UndefinedValue();
48
0
  mozilla::DropJSObjects(this);
49
0
}
50
51
void
52
ErrorEvent::GetError(JS::MutableHandle<JS::Value> aRetVal) const
53
0
{
54
0
  JS::ExposeValueToActiveJS(mError);
55
0
  aRetVal.set(mError);
56
0
}
57
58
ErrorEvent*
59
ErrorEvent::AsErrorEvent()
60
0
{
61
0
  return this;
62
0
}
63
64
JSObject*
65
ErrorEvent::WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
66
0
{
67
0
  return ErrorEvent_Binding::Wrap(aCx, this, aGivenProto);
68
0
}
69
70
already_AddRefed<ErrorEvent>
71
ErrorEvent::Constructor(mozilla::dom::EventTarget* aOwner, const nsAString& aType, const ErrorEventInit& aEventInitDict)
72
0
{
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
0
}
86
87
already_AddRefed<ErrorEvent>
88
ErrorEvent::Constructor(const GlobalObject& aGlobal, const nsAString& aType, const ErrorEventInit& aEventInitDict, ErrorResult& aRv)
89
0
{
90
0
  nsCOMPtr<mozilla::dom::EventTarget> owner = do_QueryInterface(aGlobal.GetAsSupports());
91
0
  return Constructor(owner, aType, aEventInitDict);
92
0
}
93
94
void
95
ErrorEvent::GetMessage(nsString& aRetVal) const
96
0
{
97
0
  aRetVal = mMessage;
98
0
}
99
100
void
101
ErrorEvent::GetFilename(nsString& aRetVal) const
102
0
{
103
0
  aRetVal = mFilename;
104
0
}
105
106
uint32_t
107
ErrorEvent::Lineno() const
108
0
{
109
0
  return mLineno;
110
0
}
111
112
uint32_t
113
ErrorEvent::Colno() const
114
0
{
115
0
  return mColno;
116
0
}
117
118
void
119
ErrorEvent::GetError(JSContext* cx, JS::MutableHandle<JS::Value> aRetVal) const
120
0
{
121
0
  GetError(aRetVal);
122
0
}
123
124
125
} // namespace dom
126
} // namespace mozilla