CommonIdentifiers.h 4.07 KB
Newer Older
mjs's avatar
mjs committed
1
/*
darin@apple.com's avatar
darin@apple.com committed
2
 *  Copyright (C) 2003, 2007, 2009 Apple Inc. All rights reserved.
mjs's avatar
mjs committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Library General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Library General Public License for more details.
 *
 *  You should have received a copy of the GNU Library General Public License
 *  along with this library; see the file COPYING.LIB.  If not, write to
 *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 *  Boston, MA 02110-1301, USA.
 *
 */

21 22
#ifndef CommonIdentifiers_h
#define CommonIdentifiers_h
mjs's avatar
mjs committed
23

24
#include "Identifier.h"
mjs's avatar
mjs committed
25 26
#include <wtf/Noncopyable.h>

27
// MarkedArgumentBuffer of property names, passed to a macro so we can do set them up various
mjs's avatar
mjs committed
28
// ways without repeating the list.
29
#define JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \
ap@webkit.org's avatar
ap@webkit.org committed
30 31 32 33 34
    macro(__defineGetter__) \
    macro(__defineSetter__) \
    macro(__lookupGetter__) \
    macro(__lookupSetter__) \
    macro(apply) \
mjs's avatar
mjs committed
35
    macro(arguments) \
36
    macro(bind) \
ap@webkit.org's avatar
ap@webkit.org committed
37
    macro(call) \
mjs's avatar
mjs committed
38 39
    macro(callee) \
    macro(caller) \
ap@webkit.org's avatar
ap@webkit.org committed
40
    macro(compile) \
41
    macro(configurable) \
mjs's avatar
mjs committed
42
    macro(constructor) \
43
    macro(enumerable) \
ap@webkit.org's avatar
ap@webkit.org committed
44 45
    macro(eval) \
    macro(exec) \
mjs's avatar
mjs committed
46
    macro(fromCharCode) \
oliver's avatar
oliver committed
47
    macro(global) \
48
    macro(get) \
ap@webkit.org's avatar
ap@webkit.org committed
49
    macro(hasOwnProperty) \
oliver's avatar
oliver committed
50 51 52
    macro(ignoreCase) \
    macro(index) \
    macro(input) \
53
    macro(isArray) \
ap@webkit.org's avatar
ap@webkit.org committed
54
    macro(isPrototypeOf) \
mjs's avatar
mjs committed
55 56
    macro(length) \
    macro(message) \
oliver's avatar
oliver committed
57
    macro(multiline) \
mjs's avatar
mjs committed
58
    macro(name) \
59
    macro(now) \
ap@webkit.org's avatar
ap@webkit.org committed
60 61
    macro(parse) \
    macro(propertyIsEnumerable) \
mjs's avatar
mjs committed
62
    macro(prototype) \
63
    macro(set) \
oliver's avatar
oliver committed
64
    macro(source) \
oliver@apple.com's avatar
oliver@apple.com committed
65
    macro(stack) \
ap@webkit.org's avatar
ap@webkit.org committed
66
    macro(test) \
mjs's avatar
mjs committed
67
    macro(toExponential) \
oliver's avatar
oliver committed
68
    macro(toFixed) \
69
    macro(toISOString) \
70
    macro(toJSON) \
oliver's avatar
oliver committed
71
    macro(toLocaleString) \
mjs's avatar
mjs committed
72
    macro(toPrecision) \
oliver's avatar
oliver committed
73
    macro(toString) \
ap@webkit.org's avatar
ap@webkit.org committed
74
    macro(UTC) \
75
    macro(value) \
76
    macro(valueOf) \
77
    macro(writable) \
78 79
    macro(displayName) \
    macro(undefined)
mjs's avatar
mjs committed
80

81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
#define JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(macro) \
    macro(null) \
    macro(true) \
    macro(false) \
    macro(break) \
    macro(case) \
    macro(catch) \
    macro(const) \
    macro(default) \
    macro(finally) \
    macro(for) \
    macro(instanceof) \
    macro(new) \
    macro(var) \
    macro(continue) \
    macro(function) \
    macro(return) \
    macro(void) \
    macro(delete) \
    macro(if) \
    macro(this) \
    macro(do) \
    macro(while) \
    macro(else) \
    macro(in) \
    macro(switch) \
    macro(throw) \
    macro(try) \
    macro(typeof) \
    macro(with) \
    macro(debugger) \
    macro(class) \
    macro(enum) \
    macro(export) \
    macro(extends) \
    macro(import) \
117 118 119 120 121 122 123 124 125 126
    macro(super) \
    macro(implements) \
    macro(interface) \
    macro(let) \
    macro(package) \
    macro(private) \
    macro(protected) \
    macro(public) \
    macro(static) \
    macro(yield)
127

128
namespace JSC {
mjs's avatar
mjs committed
129

130 131
    class CommonIdentifiers {
        WTF_MAKE_NONCOPYABLE(CommonIdentifiers); WTF_MAKE_FAST_ALLOCATED;
mjs's avatar
mjs committed
132
    private:
ap@webkit.org's avatar
ap@webkit.org committed
133
        CommonIdentifiers(JSGlobalData*);
eric@webkit.org's avatar
eric@webkit.org committed
134
        friend class JSGlobalData;
mjs's avatar
mjs committed
135 136

    public:
137
        const Identifier nullIdentifier;
darin@apple.com's avatar
darin@apple.com committed
138
        const Identifier emptyIdentifier;
mjs's avatar
mjs committed
139
        const Identifier underscoreProto;
140
        const Identifier thisIdentifier;
141
        const Identifier useStrictIdentifier;
mjs's avatar
mjs committed
142

143 144 145 146 147
        
#define JSC_IDENTIFIER_DECLARE_KEYWORD_NAME_GLOBAL(name) const Identifier name##Keyword;
        JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(JSC_IDENTIFIER_DECLARE_KEYWORD_NAME_GLOBAL)
#undef JSC_IDENTIFIER_DECLARE_KEYWORD_NAME_GLOBAL
        
148 149 150
#define JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL(name) const Identifier name;
        JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL)
#undef JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL
mjs's avatar
mjs committed
151 152
    };

153
} // namespace JSC
mjs's avatar
mjs committed
154

155
#endif // CommonIdentifiers_h