Changeset 31962 in webkit for trunk/JavaScriptCore/API/JSObjectRef.cpp
- Timestamp:
- Apr 16, 2008, 1:58:46 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSObjectRef.cpp
r31746 r31962 180 180 JSValue* jsValue = toJS(value); 181 181 182 // If non-0 attributes were passed, we may need to use a lower-level call than 183 // the normal JSObject::put. If there is no existing property, then use either 184 // initializeVariable or putDirect instead, since those have the power to set attributes. 185 if (attributes && !jsObject->hasProperty(exec, name)) { 186 if (jsObject->isGlobalObject()) 187 static_cast<JSGlobalObject*>(jsObject)->initializeVariable(exec, name, jsValue, attributes); 188 else 189 jsObject->putDirect(name, jsValue, attributes); 190 return; 191 } 192 193 jsObject->put(exec, name, jsValue); 182 if (attributes && !jsObject->hasProperty(exec, name)) 183 jsObject->putWithAttributes(exec, name, jsValue, attributes); 184 else 185 jsObject->put(exec, name, jsValue); 186 194 187 if (exec->hadException()) { 195 188 if (exception)
Note:
See TracChangeset
for help on using the changeset viewer.