diff --git a/src/duk_errmsg.c b/src/duk_errmsg.c new file mode 100644 index 00000000..ed8dcf5f --- /dev/null +++ b/src/duk_errmsg.c @@ -0,0 +1,10 @@ +/* + * Shared error message strings + * + * To minimize code footprint, try to share error messages inside Duktape + * code. + */ + +#include "duk_internal.h" + +const char *duk_errmsg_invalid_count = "invalid count"; diff --git a/src/duk_errmsg.h b/src/duk_errmsg.h new file mode 100644 index 00000000..4a78fdb2 --- /dev/null +++ b/src/duk_errmsg.h @@ -0,0 +1,6 @@ +#ifndef DUK_ERRMSG_H_INCLUDED +#define DUK_ERRMSG_H_INCLUDED + +extern const char *duk_errmsg_invalid_count; + +#endif /* DUK_ERRMSG_H_INCLUDED */ diff --git a/src/duk_internal.h b/src/duk_internal.h index aa8025de..b048d325 100644 --- a/src/duk_internal.h +++ b/src/duk_internal.h @@ -48,6 +48,7 @@ DUK_USE_USER_DECLARE() #include "duk_forwdecl.h" #include "duk_builtins.h" /* autogenerated: strings and built-in object init data */ +#include "duk_errmsg.h" #include "duk_js_bytecode.h" #include "duk_lexer.h" #include "duk_js_compiler.h"