CommonIdentifiers.h 3.01 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(create) \
43
    macro(defineProperty) \
44
    macro(defineProperties) \
45
    macro(enumerable) \
ap@webkit.org's avatar
ap@webkit.org committed
46 47
    macro(eval) \
    macro(exec) \
mjs's avatar
mjs committed
48
    macro(fromCharCode) \
oliver's avatar
oliver committed
49
    macro(global) \
50
    macro(get) \
51
    macro(getPrototypeOf) \
52
    macro(getOwnPropertyDescriptor) \
53
    macro(getOwnPropertyNames) \
ap@webkit.org's avatar
ap@webkit.org committed
54
    macro(hasOwnProperty) \
oliver's avatar
oliver committed
55 56 57
    macro(ignoreCase) \
    macro(index) \
    macro(input) \
58
    macro(isArray) \
ap@webkit.org's avatar
ap@webkit.org committed
59
    macro(isPrototypeOf) \
oliver@apple.com's avatar
oliver@apple.com committed
60
    macro(keys) \
mjs's avatar
mjs committed
61 62
    macro(length) \
    macro(message) \
oliver's avatar
oliver committed
63
    macro(multiline) \
mjs's avatar
mjs committed
64
    macro(name) \
65
    macro(now) \
ap@webkit.org's avatar
ap@webkit.org committed
66 67
    macro(parse) \
    macro(propertyIsEnumerable) \
mjs's avatar
mjs committed
68
    macro(prototype) \
69
    macro(set) \
oliver's avatar
oliver committed
70
    macro(source) \
ap@webkit.org's avatar
ap@webkit.org committed
71
    macro(test) \
mjs's avatar
mjs committed
72
    macro(toExponential) \
oliver's avatar
oliver committed
73
    macro(toFixed) \
74
    macro(toISOString) \
75
    macro(toJSON) \
oliver's avatar
oliver committed
76
    macro(toLocaleString) \
mjs's avatar
mjs committed
77
    macro(toPrecision) \
oliver's avatar
oliver committed
78
    macro(toString) \
ap@webkit.org's avatar
ap@webkit.org committed
79
    macro(UTC) \
80
    macro(value) \
81
    macro(valueOf) \
82
    macro(writable) \
83
    macro(displayName)
mjs's avatar
mjs committed
84

85
namespace JSC {
mjs's avatar
mjs committed
86

bfulgham@webkit.org's avatar
bfulgham@webkit.org committed
87
    class CommonIdentifiers : public Noncopyable {
mjs's avatar
mjs committed
88
    private:
ap@webkit.org's avatar
ap@webkit.org committed
89
        CommonIdentifiers(JSGlobalData*);
eric@webkit.org's avatar
eric@webkit.org committed
90
        friend class JSGlobalData;
mjs's avatar
mjs committed
91 92

    public:
93
        const Identifier nullIdentifier;
darin@apple.com's avatar
darin@apple.com committed
94
        const Identifier emptyIdentifier;
mjs's avatar
mjs committed
95
        const Identifier underscoreProto;
96
        const Identifier thisIdentifier;
97
        const Identifier useStrictIdentifier;
mjs's avatar
mjs committed
98

99 100 101
#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
102 103
    };

104
} // namespace JSC
mjs's avatar
mjs committed
105

106
#endif // CommonIdentifiers_h