Bug 790349 - Allow atoms to be referred to by |cx->names().foo| where |foo| is the text of the atom (except in cases where the text of the atom isn't a C++ identifier). r=jorendorff

This commit is contained in:
Jeff Walden
2012-09-10 13:27:19 -07:00
parent b99f02a643
commit 173167f103
9 changed files with 161 additions and 157 deletions

View File

@@ -61,7 +61,7 @@ const char * js::TypeStrings[] = {
JS_FOR_EACH_PROTOTYPE(DEFINE_PROTO_STRING)
#undef DEFINE_PROTO_STRING
#define CONST_CHAR_STR(id, text) const char js_##id##_str[] = text;
#define CONST_CHAR_STR(idpart, id, text) const char js_##idpart##_str[] = text;
FOR_EACH_COMMON_PROPERTYNAME(CONST_CHAR_STR)
#undef CONST_CHAR_STR
@@ -151,7 +151,7 @@ bool
js::InitCommonNames(JSContext *cx)
{
static const CommonNameInfo cachedNames[] = {
#define COMMON_NAME_INFO(id, text) { js_##id##_str, sizeof(text) - 1 },
#define COMMON_NAME_INFO(idpart, id, text) { js_##idpart##_str, sizeof(text) - 1 },
FOR_EACH_COMMON_PROPERTYNAME(COMMON_NAME_INFO)
#undef COMMON_NAME_INFO
#define COMMON_NAME_INFO(name, code, init) { js_##name##_str, sizeof(#name) - 1 },