Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
duktape-1.5.2/src-separate/duk_hobject_misc.c
Go to the documentation of this file.
1/*
2 * Misc support functions
3 */
4
5#include "duk_internal.h"
6
8 duk_uint_t sanity;
9
10 DUK_ASSERT(thr != NULL);
11
12 /* False if the object is NULL or the prototype 'p' is NULL.
13 * In particular, false if both are NULL (don't compare equal).
14 */
15 if (h == NULL || p == NULL) {
16 return 0;
17 }
18
20 do {
21 if (h == p) {
22 return 1;
23 }
24
25 if (sanity-- == 0) {
26 if (ignore_loop) {
27 break;
28 } else {
30 }
31 }
33 } while (h);
34
35 return 0;
36}
37
39#ifdef DUK_USE_REFERENCE_COUNTING
40 duk_hobject *tmp;
41
42 DUK_ASSERT(h);
43 tmp = DUK_HOBJECT_GET_PROTOTYPE(thr->heap, h);
45 DUK_HOBJECT_INCREF_ALLOWNULL(thr, p); /* avoid problems if p == h->prototype */
47#else
48 DUK_ASSERT(h);
49 DUK_UNREF(thr);
51#endif
52}
duk_uint_fast32_t duk_uint_t
duk_small_int_t duk_bool_t
#define DUK_ERROR_RANGE(thr, msg)
#define DUK_HOBJECT_DECREF_ALLOWNULL(thr, h)
#define DUK_HOBJECT_GET_PROTOTYPE(heap, h)
#define DUK_STR_PROTOTYPE_CHAIN_LIMIT
#define DUK_HOBJECT_PROTOTYPE_CHAIN_SANITY
#define DUK_HOBJECT_SET_PROTOTYPE(heap, h, x)
#define DUK_HOBJECT_INCREF_ALLOWNULL(thr, h)
DUK_INTERNAL duk_bool_t duk_hobject_prototype_chain_contains(duk_hthread *thr, duk_hobject *h, duk_hobject *p, duk_bool_t ignore_loop)
DUK_INTERNAL void duk_hobject_set_prototype_updref(duk_hthread *thr, duk_hobject *h, duk_hobject *p)
#define NULL
Definition gmacros.h:924