|
|
@ -25,8 +25,13 @@ JSObjectRef get_function(JSContextRef ctx, char *namespace, char *name);
|
|
25
|
25
|
|
|
26
|
26
|
char* get_contents(char *path);
|
|
27
|
27
|
|
|
28
|
|
void debug_print_value(char *prefix, JSContextRef ctx, JSValueRef exception) {
|
|
29
|
28
|
#ifdef DEBUG
|
|
|
29
|
#define debug_print_value(prefix, ctx, val) print_value(prefix, ctx, val);
|
|
|
30
|
#else
|
|
|
31
|
#define debug_print_value(prefix, ctx, val) ;
|
|
|
32
|
#endif
|
|
|
33
|
|
|
|
34
|
void print_value(char *prefix, JSContextRef ctx, JSValueRef exception) {
|
|
30
|
35
|
if (exception != NULL) {
|
|
31
|
36
|
JSStringRef ex_str = to_string(ctx, exception);
|
|
32
|
37
|
char ex_buf[1000];
|
|
|
@ -35,7 +40,6 @@ void debug_print_value(char *prefix, JSContextRef ctx, JSValueRef exception) {
|
|
35
|
40
|
printf("%s: %s\n", prefix, ex_buf);
|
|
36
|
41
|
JSStringRelease(ex_str);
|
|
37
|
42
|
}
|
|
38
|
|
#endif
|
|
39
|
43
|
}
|
|
40
|
44
|
|
|
41
|
45
|
JSValueRef function_console_log(JSContextRef ctx, JSObjectRef function, JSObjectRef this_object,
|