1 | /*
|
---|
2 | * Copyright (C) 2006 Maks Orlovich
|
---|
3 | * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
|
---|
4 | *
|
---|
5 | * This library is free software; you can redistribute it and/or
|
---|
6 | * modify it under the terms of the GNU Library General Public
|
---|
7 | * License as published by the Free Software Foundation; either
|
---|
8 | * version 2 of the License, or (at your option) any later version.
|
---|
9 | *
|
---|
10 | * This library is distributed in the hope that it will be useful,
|
---|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
13 | * Library General Public License for more details.
|
---|
14 | *
|
---|
15 | * You should have received a copy of the GNU Library General Public License
|
---|
16 | * along with this library; see the file COPYING.LIB. If not, write to
|
---|
17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
---|
18 | * Boston, MA 02110-1301, USA.
|
---|
19 | *
|
---|
20 | */
|
---|
21 |
|
---|
22 | #ifndef KJS_JSWrapperObject_h
|
---|
23 | #define KJS_JSWrapperObject_h
|
---|
24 |
|
---|
25 | #include "JSObject.h"
|
---|
26 |
|
---|
27 | namespace JSC {
|
---|
28 |
|
---|
29 | // This class is used as a base for classes such as String,
|
---|
30 | // Number, Boolean and Date which are wrappers for primitive types.
|
---|
31 | class JSWrapperObject : public JSObject {
|
---|
32 | public:
|
---|
33 | explicit JSWrapperObject(PassRefPtr<StructureID>);
|
---|
34 |
|
---|
35 | JSValuePtr internalValue() const { return m_internalValue; }
|
---|
36 | void setInternalValue(JSValuePtr);
|
---|
37 |
|
---|
38 | virtual void mark();
|
---|
39 |
|
---|
40 | private:
|
---|
41 | JSValuePtr m_internalValue;
|
---|
42 | };
|
---|
43 |
|
---|
44 | inline JSWrapperObject::JSWrapperObject(PassRefPtr<StructureID> structure)
|
---|
45 | : JSObject(structure)
|
---|
46 | , m_internalValue(0)
|
---|
47 | {
|
---|
48 | }
|
---|
49 |
|
---|
50 | inline void JSWrapperObject::setInternalValue(JSValuePtr value)
|
---|
51 | {
|
---|
52 | ASSERT(value);
|
---|
53 | ASSERT(!value->isObject());
|
---|
54 | m_internalValue = value;
|
---|
55 | }
|
---|
56 |
|
---|
57 | } // namespace JSC
|
---|
58 |
|
---|
59 | #endif // KJS_JSWrapperObject_h
|
---|