/src/mozilla-central/dom/console/ConsoleCommon.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
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 | | #ifndef mozilla_dom_ConsoleCommon_h |
8 | | #define mozilla_dom_ConsoleCommon_h |
9 | | |
10 | | #include "nsString.h" |
11 | | |
12 | | namespace mozilla { |
13 | | namespace dom { |
14 | | namespace ConsoleCommon { |
15 | | |
16 | | // This class is used to clear any exception at the end of this method. |
17 | | class MOZ_RAII ClearException |
18 | | { |
19 | | public: |
20 | | explicit ClearException(JSContext* aCx) |
21 | | : mCx(aCx) |
22 | 0 | { |
23 | 0 | } |
24 | | |
25 | | ~ClearException() |
26 | 0 | { |
27 | 0 | JS_ClearPendingException(mCx); |
28 | 0 | } |
29 | | |
30 | | private: |
31 | | JSContext* mCx; |
32 | | }; |
33 | | |
34 | | } // namespace ConsoleCommon |
35 | | } // namespace dom |
36 | | } // namespace mozilla |
37 | | |
38 | | #endif /* mozilla_dom_ConsoleCommon_h */ |