source:
webkit/trunk/JavaScriptCore/kjs/reference.h@
10218
Last change on this file since 10218 was 10084, checked in by darin, 20 years ago | |
---|---|
WebCore:
|
|
|
|
File size: 2.4 KB |
Line | |
---|---|
1 | // -*- c-basic-offset: 2 -*- |
2 | /* |
3 | * This file is part of the KDE libraries |
4 | * Copyright (C) 2003 Apple Computer, Inc |
5 | * |
6 | * This library is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU Library General Public |
8 | * License as published by the Free Software Foundation; either |
9 | * version 2 of the License, or (at your option) any later version. |
10 | * |
11 | * This library is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | * Library General Public License for more details. |
15 | * |
16 | * You should have received a copy of the GNU Library General Public License |
17 | * along with this library; see the file COPYING.LIB. If not, write to |
18 | * the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, |
19 | * Boston, MA 02110-1301, USA. |
20 | * |
21 | */ |
22 | |
23 | #ifndef _KJS_REFERENCE_H_ |
24 | #define _KJS_REFERENCE_H_ |
25 | |
26 | #include "identifier.h" |
27 | #include "object.h" |
28 | |
29 | namespace KJS { |
30 | |
31 | class ObjectImp; |
32 | |
33 | class Reference { |
34 | friend class ReferenceList; |
35 | friend class ReferenceListIterator; |
36 | friend class ProtectedReference; |
37 | public: |
38 | Reference(ObjectImp *b, const Identifier& p); |
39 | Reference(ObjectImp *b, unsigned p); |
40 | Reference(const Identifier& p); |
41 | Reference(unsigned p); |
42 | static Reference makeValueReference(ValueImp *); |
43 | |
44 | /** |
45 | * Performs the GetBase type conversion operation on this value (ECMA 8.7) |
46 | * |
47 | * Since references are supposed to have an Object or null as their base, |
48 | * this method is guaranteed to return either Null() or an Object value. |
49 | */ |
50 | ValueImp *getBase(ExecState *exec) const; |
51 | |
52 | /** |
53 | * Performs the GetPropertyName type conversion operation on this value |
54 | * (ECMA 8.7) |
55 | */ |
56 | Identifier getPropertyName(ExecState *exec) const; |
57 | |
58 | /** |
59 | * Performs the GetValue type conversion operation on this value |
60 | * (ECMA 8.7.1) |
61 | */ |
62 | ValueImp *getValue(ExecState *exec) const; |
63 | |
64 | /** |
65 | * Performs the PutValue type conversion operation on this value |
66 | * (ECMA 8.7.1) |
67 | */ |
68 | void putValue(ExecState *exec, ValueImp *); |
69 | bool deleteValue(ExecState *exec); |
70 | |
71 | ValueImp *baseIfMutable() const { return baseIsValue ? 0 : base; } |
72 | |
73 | private: |
74 | Reference() { } |
75 | |
76 | ValueImp *base; |
77 | unsigned propertyNameAsNumber; |
78 | bool baseIsValue; |
79 | bool propertyNameIsNumber; |
80 | mutable Identifier prop; |
81 | }; |
82 | |
83 | } |
84 | |
85 | #endif |
Note:
See TracBrowser
for help on using the repository browser.