CommonIdentifiers.h 3.83 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) \
ap@webkit.org's avatar
ap@webkit.org committed
36
    macro(call) \
mjs's avatar
mjs committed
37 38
    macro(callee) \
    macro(caller) \
ap@webkit.org's avatar
ap@webkit.org committed
39
    macro(compile) \
40
    macro(configurable) \
mjs's avatar
mjs committed
41
    macro(constructor) \
42
    macro(enumerable) \
ap@webkit.org's avatar
ap@webkit.org committed
43 44
    macro(eval) \
    macro(exec) \
mjs's avatar
mjs committed
45
    macro(fromCharCode) \
oliver's avatar
oliver committed
46
    macro(global) \
47
    macro(get) \
ap@webkit.org's avatar
ap@webkit.org committed
48
    macro(hasOwnProperty) \
oliver's avatar
oliver committed
49 50 51
    macro(ignoreCase) \
    macro(index) \
    macro(input) \
52
    macro(isArray) \
ap@webkit.org's avatar
ap@webkit.org committed
53
    macro(isPrototypeOf) \
mjs's avatar
mjs committed
54 55
    macro(length) \
    macro(message) \
oliver's avatar
oliver committed
56
    macro(multiline) \
mjs's avatar
mjs committed
57
    macro(name) \
58
    macro(now) \
ap@webkit.org's avatar
ap@webkit.org committed
59 60
    macro(parse) \
    macro(propertyIsEnumerable) \
mjs's avatar
mjs committed
61
    macro(prototype) \
62
    macro(set) \
oliver's avatar
oliver committed
63
    macro(source) \
ap@webkit.org's avatar
ap@webkit.org committed
64
    macro(test) \
mjs's avatar
mjs committed
65
    macro(toExponential) \
oliver's avatar
oliver committed
66
    macro(toFixed) \
67
    macro(toISOString) \
68
    macro(toJSON) \
oliver's avatar
oliver committed
69
    macro(toLocaleString) \
mjs's avatar
mjs committed
70
    macro(toPrecision) \
oliver's avatar
oliver committed
71
    macro(toString) \
ap@webkit.org's avatar
ap@webkit.org committed
72
    macro(UTC) \
73
    macro(value) \
74
    macro(valueOf) \
75
    macro(writable) \
76
    macro(displayName)
mjs's avatar
mjs committed
77

78 79 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
#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) \
    macro(super)

116
namespace JSC {
mjs's avatar
mjs committed
117

118 119
    class CommonIdentifiers {
        WTF_MAKE_NONCOPYABLE(CommonIdentifiers); WTF_MAKE_FAST_ALLOCATED;
mjs's avatar
mjs committed
120
    private:
ap@webkit.org's avatar
ap@webkit.org committed
121
        CommonIdentifiers(JSGlobalData*);
eric@webkit.org's avatar
eric@webkit.org committed
122
        friend class JSGlobalData;
mjs's avatar
mjs committed
123 124

    public:
125
        const Identifier nullIdentifier;
darin@apple.com's avatar
darin@apple.com committed
126
        const Identifier emptyIdentifier;
mjs's avatar
mjs committed
127
        const Identifier underscoreProto;
128
        const Identifier thisIdentifier;
129
        const Identifier useStrictIdentifier;
mjs's avatar
mjs committed
130

131 132 133 134 135
        
#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
        
136 137 138
#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
139 140
    };

141
} // namespace JSC
mjs's avatar
mjs committed
142

143
#endif // CommonIdentifiers_h