]> git.saurik.com Git - apple/javascriptcore.git/blob - runtime/CommonIdentifiers.h
JavaScriptCore-1097.13.tar.gz
[apple/javascriptcore.git] / runtime / CommonIdentifiers.h
1 /*
2 * Copyright (C) 2003, 2007, 2009 Apple Inc. All rights reserved.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 *
19 */
20
21 #ifndef CommonIdentifiers_h
22 #define CommonIdentifiers_h
23
24 #include "Identifier.h"
25 #include <wtf/Noncopyable.h>
26
27 // MarkedArgumentBuffer of property names, passed to a macro so we can do set them up various
28 // ways without repeating the list.
29 #define JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \
30 macro(apply) \
31 macro(arguments) \
32 macro(bind) \
33 macro(call) \
34 macro(callee) \
35 macro(caller) \
36 macro(compile) \
37 macro(configurable) \
38 macro(constructor) \
39 macro(enumerable) \
40 macro(eval) \
41 macro(exec) \
42 macro(fromCharCode) \
43 macro(global) \
44 macro(get) \
45 macro(hasOwnProperty) \
46 macro(ignoreCase) \
47 macro(index) \
48 macro(input) \
49 macro(isArray) \
50 macro(isPrototypeOf) \
51 macro(lastIndex) \
52 macro(length) \
53 macro(message) \
54 macro(multiline) \
55 macro(name) \
56 macro(now) \
57 macro(parse) \
58 macro(propertyIsEnumerable) \
59 macro(prototype) \
60 macro(set) \
61 macro(source) \
62 macro(stack) \
63 macro(test) \
64 macro(toExponential) \
65 macro(toFixed) \
66 macro(toISOString) \
67 macro(toJSON) \
68 macro(toLocaleString) \
69 macro(toPrecision) \
70 macro(toString) \
71 macro(UTC) \
72 macro(value) \
73 macro(valueOf) \
74 macro(writable) \
75 macro(displayName) \
76 macro(join)
77
78 #define JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(macro) \
79 macro(null) \
80 macro(undefined) \
81 macro(true) \
82 macro(false) \
83 macro(break) \
84 macro(case) \
85 macro(catch) \
86 macro(const) \
87 macro(default) \
88 macro(finally) \
89 macro(for) \
90 macro(instanceof) \
91 macro(new) \
92 macro(var) \
93 macro(continue) \
94 macro(function) \
95 macro(return) \
96 macro(void) \
97 macro(delete) \
98 macro(if) \
99 macro(this) \
100 macro(do) \
101 macro(while) \
102 macro(else) \
103 macro(in) \
104 macro(switch) \
105 macro(throw) \
106 macro(try) \
107 macro(typeof) \
108 macro(with) \
109 macro(debugger) \
110 macro(class) \
111 macro(enum) \
112 macro(export) \
113 macro(extends) \
114 macro(import) \
115 macro(super) \
116 macro(implements) \
117 macro(interface) \
118 macro(let) \
119 macro(package) \
120 macro(private) \
121 macro(protected) \
122 macro(public) \
123 macro(static) \
124 macro(yield)
125
126 namespace JSC {
127
128 class CommonIdentifiers {
129 WTF_MAKE_NONCOPYABLE(CommonIdentifiers); WTF_MAKE_FAST_ALLOCATED;
130 private:
131 CommonIdentifiers(JSGlobalData*);
132 friend class JSGlobalData;
133
134 public:
135 const Identifier nullIdentifier;
136 const Identifier emptyIdentifier;
137 const Identifier underscoreProto;
138 const Identifier thisIdentifier;
139 const Identifier useStrictIdentifier;
140
141
142 #define JSC_IDENTIFIER_DECLARE_KEYWORD_NAME_GLOBAL(name) const Identifier name##Keyword;
143 JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(JSC_IDENTIFIER_DECLARE_KEYWORD_NAME_GLOBAL)
144 #undef JSC_IDENTIFIER_DECLARE_KEYWORD_NAME_GLOBAL
145
146 #define JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL(name) const Identifier name;
147 JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL)
148 #undef JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL
149 };
150
151 } // namespace JSC
152
153 #endif // CommonIdentifiers_h