Changeset 30534 in webkit for trunk/JavaScriptCore/API
- Timestamp:
- Feb 23, 2008, 9:01:27 PM (17 years ago)
- Location:
- trunk/JavaScriptCore/API
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSCallbackObject.h
r29663 r30534 48 48 virtual bool getOwnPropertySlot(ExecState*, unsigned, PropertySlot&); 49 49 50 virtual void put(ExecState*, const Identifier&, JSValue* , int attr);51 virtual void put(ExecState*, unsigned, JSValue* , int attr);50 virtual void put(ExecState*, const Identifier&, JSValue*); 51 virtual void put(ExecState*, unsigned, JSValue*); 52 52 53 53 virtual bool deleteProperty(ExecState*, const Identifier&); -
trunk/JavaScriptCore/API/JSCallbackObjectFunctions.h
r29663 r30534 151 151 152 152 template <class Base> 153 void JSCallbackObject<Base>::put(ExecState* exec, const Identifier& propertyName, JSValue* value , int attr)153 void JSCallbackObject<Base>::put(ExecState* exec, const Identifier& propertyName, JSValue* value) 154 154 { 155 155 JSContextRef ctx = toRef(exec); … … 182 182 if (entry->attributes & kJSPropertyAttributeReadOnly) 183 183 return; 184 JSCallbackObject<Base>::putDirect(propertyName, value , attr); // put as override property184 JSCallbackObject<Base>::putDirect(propertyName, value); // put as override property 185 185 return; 186 186 } … … 188 188 } 189 189 190 return Base::put(exec, propertyName, value , attr);191 } 192 193 template <class Base> 194 void JSCallbackObject<Base>::put(ExecState* exec, unsigned propertyName, JSValue* value , int attr)195 { 196 return put(exec, Identifier::from(propertyName), value , attr);190 return Base::put(exec, propertyName, value); 191 } 192 193 template <class Base> 194 void JSCallbackObject<Base>::put(ExecState* exec, unsigned propertyName, JSValue* value) 195 { 196 return put(exec, Identifier::from(propertyName), value); 197 197 } 198 198 -
trunk/JavaScriptCore/API/JSObjectRef.cpp
r30413 r30534 1 1 // -*- mode: c++; c-basic-offset: 4 -*- 2 2 /* 3 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 4 4 * 5 5 * Redistribution and use in source and binary forms, with or without … … 28 28 #include "JSObjectRef.h" 29 29 30 #include <wtf/Platform.h>31 30 #include "APICast.h" 32 #include "JSValueRef.h"33 31 #include "JSCallbackConstructor.h" 34 32 #include "JSCallbackFunction.h" … … 36 34 #include "JSClassRef.h" 37 35 #include "JSGlobalObject.h" 38 36 #include "JSValueRef.h" 39 37 #include "PropertyNameArray.h" 40 38 #include "function.h" … … 44 42 #include "object.h" 45 43 #include "object_object.h" 44 #include <wtf/Platform.h> 46 45 47 46 using namespace KJS; … … 178 177 ExecState* exec = toJS(ctx); 179 178 JSObject* jsObject = toJS(object); 180 UString::Rep* nameRep = toJS(propertyName);179 Identifier name(toJS(propertyName)); 181 180 JSValue* jsValue = toJS(value); 182 183 jsObject->put(exec, Identifier(nameRep), jsValue, attributes); 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); 184 194 if (exec->hadException()) { 185 195 if (exception)
Note:
See TracChangeset
for help on using the changeset viewer.