Browse Source

FIXME cleanup: 'anon' string

v1.0-maintenance
Sami Vaarala 10 years ago
parent
commit
e81caf20c4
  1. 7
      src/duk_bi_function.c
  2. 3
      src/duk_strings.c
  3. 3
      src/duk_strings.h

7
src/duk_bi_function.c

@ -4,9 +4,6 @@
#include "duk_internal.h"
/* FIXME: shared string */
const char *duk__str_anon = "anon";
duk_ret_t duk_bi_function_constructor(duk_context *ctx) {
duk_hthread *thr = (duk_hthread *) ctx;
duk_hstring *h_sourcecode;
@ -117,7 +114,7 @@ duk_ret_t duk_bi_function_prototype_to_string(duk_context *ctx) {
if (DUK_TVAL_IS_OBJECT(tv)) {
duk_hobject *obj = DUK_TVAL_GET_OBJECT(tv);
const char *func_name = duk__str_anon;
const char *func_name = DUK_STR_ANON;
/* XXX: rework, it would be nice to avoid C formatting functions to
* ensure there are no Unicode issues.
@ -129,7 +126,7 @@ duk_ret_t duk_bi_function_prototype_to_string(duk_context *ctx) {
DUK_ASSERT(func_name != NULL);
if (func_name[0] == (char) 0) {
func_name = duk__str_anon;
func_name = DUK_STR_ANON;
}
}

3
src/duk_strings.c

@ -133,3 +133,6 @@ const char *duk_str_func_limit = "function limit";
const char *duk_str_regexp_compiler_recursion_limit = "regexp compiler recursion limit";
const char *duk_str_regexp_executor_recursion_limit = "regexp executor recursion limit";
const char *duk_str_regexp_executor_step_limit = "regexp step limit";
/* Misc */
const char *duk_str_anon = "anon";

3
src/duk_strings.h

@ -261,4 +261,7 @@ extern const char *duk_str_regexp_compiler_recursion_limit;
extern const char *duk_str_regexp_executor_recursion_limit;
extern const char *duk_str_regexp_executor_step_limit;
#define DUK_STR_ANON duk_str_anon
extern const char *duk_str_anon;
#endif /* DUK_ERRMSG_H_INCLUDED */

Loading…
Cancel
Save