added JSObject::deleteProperty(), and changed mName in JSType to be a JSString. Need to revisit other uses of String soon.
git-svn-id: svn://10.0.0.236/trunk@73230 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
248c6cb94b
commit
9ce999f990
@ -242,6 +242,18 @@ namespace JSTypes {
|
||||
{
|
||||
return (mProperties[name] = value);
|
||||
}
|
||||
|
||||
const JSValue& deleteProperty(const String& name)
|
||||
{
|
||||
JSProperties::iterator i = mProperties.find(name);
|
||||
if (i != mProperties.end()) {
|
||||
mProperties.erase(i);
|
||||
return kTrue;
|
||||
}
|
||||
if (mPrototype)
|
||||
return mPrototype->deleteProperty(name);
|
||||
return kFalse;
|
||||
}
|
||||
|
||||
void setPrototype(JSObject* prototype)
|
||||
{
|
||||
@ -445,14 +457,14 @@ namespace JSTypes {
|
||||
|
||||
class JSType : public JSObject {
|
||||
protected:
|
||||
String mName;
|
||||
JSString mName;
|
||||
const JSType *mBaseType;
|
||||
public:
|
||||
JSType(const String &name, const JSType *baseType) : mName(name), mBaseType(baseType) { }
|
||||
|
||||
enum { NoRelation = 0x7FFFFFFF };
|
||||
|
||||
const String& getName() const { return mName; }
|
||||
const JSString& getName() const { return mName; }
|
||||
|
||||
int32 distance(const JSType *other) const;
|
||||
};
|
||||
|
||||
@ -242,6 +242,18 @@ namespace JSTypes {
|
||||
{
|
||||
return (mProperties[name] = value);
|
||||
}
|
||||
|
||||
const JSValue& deleteProperty(const String& name)
|
||||
{
|
||||
JSProperties::iterator i = mProperties.find(name);
|
||||
if (i != mProperties.end()) {
|
||||
mProperties.erase(i);
|
||||
return kTrue;
|
||||
}
|
||||
if (mPrototype)
|
||||
return mPrototype->deleteProperty(name);
|
||||
return kFalse;
|
||||
}
|
||||
|
||||
void setPrototype(JSObject* prototype)
|
||||
{
|
||||
@ -445,14 +457,14 @@ namespace JSTypes {
|
||||
|
||||
class JSType : public JSObject {
|
||||
protected:
|
||||
String mName;
|
||||
JSString mName;
|
||||
const JSType *mBaseType;
|
||||
public:
|
||||
JSType(const String &name, const JSType *baseType) : mName(name), mBaseType(baseType) { }
|
||||
|
||||
enum { NoRelation = 0x7FFFFFFF };
|
||||
|
||||
const String& getName() const { return mName; }
|
||||
const JSString& getName() const { return mName; }
|
||||
|
||||
int32 distance(const JSType *other) const;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user