MIRROR: javascript for 馃悳's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at type-hints-typescript 43 lines 1.5 kB view raw
1#ifndef ANT_DESCRIPTORS_H 2#define ANT_DESCRIPTORS_H 3 4#include "types.h" 5#include <uthash.h> 6 7#define JS_DESC_W (1 << 0) 8#define JS_DESC_E (1 << 1) 9#define JS_DESC_C (1 << 2) 10 11typedef struct descriptor_entry { 12 uint64_t key; 13 uintptr_t obj_off; 14 ant_offset_t sym_off; 15 char *prop_name; 16 size_t prop_len; 17 bool writable; 18 bool enumerable; 19 bool configurable; 20 bool has_getter; 21 bool has_setter; 22 ant_value_t getter; 23 ant_value_t setter; 24 UT_hash_handle hh; 25} descriptor_entry_t; 26 27extern descriptor_entry_t *desc_registry; 28 29descriptor_entry_t *lookup_descriptor(ant_value_t obj, const char *key, size_t klen); 30descriptor_entry_t *lookup_sym_descriptor(ant_value_t obj, ant_offset_t sym_off); 31 32uint64_t make_desc_key(ant_value_t obj, const char *key, size_t klen); 33uint64_t make_sym_desc_key(ant_value_t obj, ant_offset_t sym_off); 34 35void js_set_descriptor(ant_t *js, ant_value_t obj, const char *key, size_t klen, int flags); 36void js_set_getter_desc(ant_t *js, ant_value_t obj, const char *key, size_t klen, ant_value_t getter, int flags); 37void js_set_setter_desc(ant_t *js, ant_value_t obj, const char *key, size_t klen, ant_value_t setter, int flags); 38void js_set_accessor_desc(ant_t *js, ant_value_t obj, const char *key, size_t klen, ant_value_t getter, ant_value_t setter, int flags); 39 40void js_set_sym_getter_desc(ant_t *js, ant_value_t obj, ant_value_t sym, ant_value_t getter, int flags); 41void js_set_sym_setter_desc(ant_t *js, ant_value_t obj, ant_value_t sym, ant_value_t setter, int flags); 42 43#endif