Changeset 8453 in webkit for trunk/JavaScriptCore/bindings/runtime_object.cpp
- Timestamp:
- Jan 26, 2005, 1:38:10 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bindings/runtime_object.cpp
r8400 r8453 61 61 } 62 62 63 RuntimeObjectImp::RuntimeObjectImp(Bindings::Instance *i, const Value &fb, bool oi) : ObjectImp ((ObjectImp *)0)64 {65 ownsInstance = oi;66 instance = i;67 fallback = fb;68 }69 70 63 Value RuntimeObjectImp::get(ExecState *exec, const Identifier &propertyName) const 71 64 { … … 90 83 result = Object (new RuntimeMethodImp(exec, propertyName, methodList)); 91 84 } 92 else if (!fallback.isNull() && fallback.type() == ObjectType){93 ObjectImp *imp = static_cast<ObjectImp*>(fallback.imp());94 imp->setForwardingScriptMessage(true);95 result = imp->get (exec, propertyName);96 imp->setForwardingScriptMessage(false);97 }98 85 } 99 86 … … 121 108 } 122 109 else { 123 bool domHasProperty = false; 124 if (!fallback.isNull() && fallback.type() == ObjectType){ 125 ObjectImp *imp = static_cast<ObjectImp*>(fallback.imp()); 126 imp->setForwardingScriptMessage(true); 127 domHasProperty = imp->hasProperty(exec, propertyName); 128 imp->setForwardingScriptMessage(false); 129 } 130 131 // If the DOM has the property, give it a crack first (even if it read-only). 132 if (domHasProperty || !getInternalInstance()->supportsSetValueOfUndefinedField()) { 133 ObjectImp *imp = static_cast<ObjectImp*>(fallback.imp()); 134 imp->setForwardingScriptMessage(true); 135 imp->put(exec, propertyName, value, attr); 136 imp->setForwardingScriptMessage(false); 137 } 138 // Now let the runtime object attempt to handle the undefined field. 139 else if (getInternalInstance()->supportsSetValueOfUndefinedField()){ 110 if (getInternalInstance()->supportsSetValueOfUndefinedField()){ 140 111 getInternalInstance()->setValueOfUndefinedField(exec, propertyName, value); 141 112 } … … 158 129 return true; 159 130 160 if (!fallback.isNull() && fallback.type() == ObjectType) {161 ObjectImp *imp = static_cast<ObjectImp*>(fallback.imp());162 imp->setForwardingScriptMessage(true);163 result = imp->canPut (exec, propertyName);164 imp->setForwardingScriptMessage(false);165 }166 167 131 return result; 168 132 } … … 188 152 return true; 189 153 190 if (!fallback.isNull() && fallback.type() == ObjectType) {191 ObjectImp *imp = static_cast<ObjectImp*>(fallback.imp());192 imp->setForwardingScriptMessage(true);193 result = imp->hasProperty (exec, propertyName);194 imp->setForwardingScriptMessage(false);195 }196 197 154 return result; 198 155 } … … 211 168 instance->begin(); 212 169 213 if (!fallback.isNull() && fallback.type() == ObjectType) { 214 ObjectImp *imp = static_cast<ObjectImp*>(fallback.imp()); 215 imp->setForwardingScriptMessage(true); 216 result = imp->defaultValue (exec, hint); 217 imp->setForwardingScriptMessage(false); 218 } 219 else { 220 result = getInternalInstance()->defaultValue(hint); 221 } 170 result = getInternalInstance()->defaultValue(hint); 222 171 223 172 instance->end();
Note:
See TracChangeset
for help on using the changeset viewer.