Sming Framework API
()
Toggle main menu visibility
Sming
Libraries
jerryscript
src
include
Jerryscript
Except.h
Go to the documentation of this file.
1
/****
2
* Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
3
* Created 2015 by Skurydin Alexey
4
* http://github.com/SmingHub/Sming
5
* All files of the Sming Core are provided under the LGPL v3 license.
6
*
7
* Except.h
8
*
9
* @author: Dec 2021 - Mikee47 <mike@sillyhouse.net>
10
*
11
*/
12
13
#include "
Types.h
"
14
#include <csetjmp>
15
16
namespace
Jerryscript
17
{
18
enum class
FatalCode
{
19
#define XX(jt, t) t = jt,
20
JERRY_FATAL_CODE_MAP(
XX
)
21
#undef XX
22
};
23
24
class
Except
25
{
26
public
:
27
Except
() : prev(current)
28
{
29
current =
this
;
30
}
31
32
~Except
()
33
{
34
current = prev;
35
}
36
37
[[noreturn]]
static
void
raise
(jerry_fatal_code_t
code
);
38
39
FatalCode
code
()
40
{
41
return
mCode;
42
}
43
44
operator
String
()
const
;
45
46
std::jmp_buf
context
;
47
48
private
:
49
static
Except
* current;
50
Except
* prev;
51
FatalCode
mCode{};
52
};
53
54
#define JS_TRY() \
55
::Jerryscript::Except e; \
56
if(setjmp(e.context) == 0)
57
#define JS_CATCH() else
58
59
}
// namespace Jerryscript
60
61
String
toString
(
Jerryscript::FatalCode
code);
String
The String class.
Definition:
WString.h:136
Jerryscript::Except::Except
Except()
Definition:
Except.h:37
Jerryscript::Except::~Except
~Except()
Definition:
Except.h:42
toString
String toString(Jerryscript::FatalCode code)
Jerryscript::Except::context
std::jmp_buf context
Definition:
Except.h:56
Jerryscript
Definition:
Libraries/jerryscript/src/include/Jerryscript/Context.h:123
Types.h
Jerryscript::FatalCode
FatalCode
Definition:
Except.h:28
Jerryscript::Except::code
FatalCode code()
Definition:
Except.h:49
Jerryscript::Except
Definition:
Except.h:34
Jerryscript::FatalCode::XX
XX(jt, t)
Generated by
1.8.17