Changeset 154253 in webkit for trunk/Source/JavaScriptCore/runtime/PropertySlot.h
- Timestamp:
- Aug 18, 2013, 12:29:15 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/PropertySlot.h
r154113 r154253 33 33 class ExecState; 34 34 class GetterSetter; 35 36 // ECMA 262-3 8.6.1 37 // Property attributes 38 enum Attribute { 39 None = 0, 40 ReadOnly = 1 << 1, // property can be only read, not written 41 DontEnum = 1 << 2, // property doesn't appear in (for .. in ..) 42 DontDelete = 1 << 3, // property can't be deleted 43 Function = 1 << 4, // property is a function - only used by static hashtables 44 Accessor = 1 << 5, // property is a getter/setter 45 }; 35 46 36 47 class PropertySlot { … … 80 91 } 81 92 82 void setValue(JSObject* slotBase, JSValue value)93 void setValue(JSObject* slotBase, unsigned attributes, JSValue value) 83 94 { 84 95 ASSERT(value); 85 96 m_data.value = JSValue::encode(value); 97 m_attributes = attributes; 86 98 87 99 ASSERT(slotBase); … … 91 103 } 92 104 93 void setValue(JSObject* slotBase, JSValue value, PropertyOffset offset)105 void setValue(JSObject* slotBase, unsigned attributes, JSValue value, PropertyOffset offset) 94 106 { 95 107 ASSERT(value); 96 108 m_data.value = JSValue::encode(value); 109 m_attributes = attributes; 97 110 98 111 ASSERT(slotBase); … … 102 115 } 103 116 104 void setValue(JSString*, JSValue value)117 void setValue(JSString*, unsigned attributes, JSValue value) 105 118 { 106 119 ASSERT(value); 107 120 m_data.value = JSValue::encode(value); 121 m_attributes = attributes; 108 122 109 123 m_slotBase = 0; … … 112 126 } 113 127 114 void setCustom(JSObject* slotBase, GetValueFunc getValue)128 void setCustom(JSObject* slotBase, unsigned attributes, GetValueFunc getValue) 115 129 { 116 130 ASSERT(getValue); 117 131 m_data.custom.getValue = getValue; 132 m_attributes = attributes; 118 133 119 134 ASSERT(slotBase); … … 123 138 } 124 139 125 void setCacheableCustom(JSObject* slotBase, GetValueFunc getValue)140 void setCacheableCustom(JSObject* slotBase, unsigned attributes, GetValueFunc getValue) 126 141 { 127 142 ASSERT(getValue); 128 143 m_data.custom.getValue = getValue; 144 m_attributes = attributes; 129 145 130 146 ASSERT(slotBase); … … 134 150 } 135 151 136 void setCustomIndex(JSObject* slotBase, unsigned index, GetIndexValueFunc getIndexValue)152 void setCustomIndex(JSObject* slotBase, unsigned attributes, unsigned index, GetIndexValueFunc getIndexValue) 137 153 { 138 154 ASSERT(getIndexValue); 139 155 m_data.customIndex.getIndexValue = getIndexValue; 140 156 m_data.customIndex.index = index; 157 m_attributes = attributes; 141 158 142 159 ASSERT(slotBase); … … 146 163 } 147 164 148 void setGetterSlot(JSObject* slotBase, GetterSetter* getterSetter)165 void setGetterSlot(JSObject* slotBase, unsigned attributes, GetterSetter* getterSetter) 149 166 { 150 167 ASSERT(getterSetter); 151 168 m_data.getter.getterSetter = getterSetter; 169 m_attributes = attributes; 152 170 153 171 ASSERT(slotBase); … … 157 175 } 158 176 159 void setCacheableGetterSlot(JSObject* slotBase, GetterSetter* getterSetter, PropertyOffset offset)177 void setCacheableGetterSlot(JSObject* slotBase, unsigned attributes, GetterSetter* getterSetter, PropertyOffset offset) 160 178 { 161 179 ASSERT(getterSetter); 162 180 m_data.getter.getterSetter = getterSetter; 181 m_attributes = attributes; 163 182 164 183 ASSERT(slotBase); … … 180 199 JS_EXPORT_PRIVATE JSValue functionGetter(ExecState*) const; 181 200 201 unsigned m_attributes; 182 202 union { 183 203 EncodedJSValue value;
Note:
See TracChangeset
for help on using the changeset viewer.