Oolite
Loading...
Searching...
No Matches
OOJSEngineNativeWrappers.h
Go to the documentation of this file.
1
/*
2
3
OOJSEngineNativeWrappers.h (QuickJS-ng)
4
5
Exception safety and profiling macros.
6
7
Every JavaScript native callback that could concievably cause an
8
Objective-C exception should begin with OOJS_NATIVE_ENTER() and end with
9
OOJS_NATIVE_EXIT. Callbacks which have been carefully audited for potential
10
exceptions, and support functions called from JavaScript native callbacks,
11
may start with OOJS_PROFILE_ENTER and end with OOJS_PROFILE_EXIT to be
12
included in profiling reports.
13
14
Functions using either of these pairs _must_ return before
15
OOJS_NATIVE_EXIT/OOJS_PROFILE_EXIT, or they will crash.
16
17
For functions with a non-scalar return type, OOJS_PROFILE_EXIT should be
18
replaced with OOJS_PROFILE_EXIT_VAL(returnValue). The returnValue is never
19
used (and should be a constant expression), but is required to placate the
20
compiler.
21
22
For values with void return, use OOJS_PROFILE_EXIT_VOID. It is not
23
necessary to insert a return statement before OOJS_PROFILE_EXIT_VOID.
24
25
26
JavaScript support for Oolite
27
Copyright (C) 2007-2013 David Taylor and Jens Ayton.
28
29
This program is free software; you can redistribute it and/or
30
modify it under the terms of the GNU General Public License
31
as published by the Free Software Foundation; either version 2
32
of the License, or (at your option) any later version.
33
34
This program is distributed in the hope that it will be useful,
35
but WITHOUT ANY WARRANTY; without even the implied warranty of
36
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37
GNU General Public License for more details.
38
39
You should have received a copy of the GNU General Public License
40
along with this program; if not, write to the Free Software
41
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
42
MA 02110-1301, USA.
43
44
*/
45
46
/* With QuickJS, the exception safety and profiling macros
47
(OOJS_NATIVE_ENTER()/OOJS_NATIVE_EXIT, OOJS_PROFILE_ENTER/OOJS_PROFILE_EXIT,
48
OOJS_BEGIN_FULL_NATIVE()/OOJS_END_FULL_NATIVE and friends) are defined in
49
OOJavaScriptEngine.h, as is OOJS_PROFILE; the profiler itself is in
50
OOJSEngineTimeManagement.m. This header remains so existing imports keep
51
working.
52
*/
53
54
#import "
OOJavaScriptEngine.h
"
OOJavaScriptEngine.h
src
Core
Scripting
QuickJS
OOJSEngineNativeWrappers.h
Generated by
1.15.0