mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-11 10:08:41 +00:00
added JSObject::deleteProperty(), and changed mName in JSType to be a JSString. Need to revisit other uses of String soon.
This commit is contained in:
parent
07dff8c5d1
commit
f276cc3dfd
@ -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