| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
#ifndef StringObjectThatMasqueradesAsUndefined_h |
| 22 |
#define StringObjectThatMasqueradesAsUndefined_h |
| 23 |
|
| 24 |
#include "JSGlobalObject.h" |
| 25 |
#include "StringObject.h" |
| 26 |
#include "UString.h" |
| 27 |
|
| 28 |
namespace JSC { |
| 29 |
|
| 30 |
|
| 31 |
class StringObjectThatMasqueradesAsUndefined : public StringObject { |
| 32 |
public: |
| 33 |
static StringObjectThatMasqueradesAsUndefined* create(ExecState* exec, const UString& string) |
| 34 |
{ |
| 35 |
return new (exec) StringObjectThatMasqueradesAsUndefined(exec, |
| 36 |
createStructure(exec->lexicalGlobalObject()->stringPrototype()), string); |
| 37 |
} |
| 38 |
|
| 39 |
private: |
| 40 |
StringObjectThatMasqueradesAsUndefined(ExecState* exec, NonNullPassRefPtr<Structure> structure, const UString& string) |
| 41 |
: StringObject(exec, structure, string) |
| 42 |
{ |
| 43 |
} |
| 44 |
|
| 45 |
static PassRefPtr<Structure> createStructure(JSValue proto) |
| 46 |
{ |
| 47 |
return Structure::create(proto, TypeInfo(ObjectType, StructureFlags)); |
| 48 |
} |
| 49 |
|
| 50 |
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | MasqueradesAsUndefined | OverridesGetPropertyNames | StringObject::StructureFlags; |
| 51 |
|
| 52 |
virtual bool toBoolean(ExecState*) const { return false; } |
| 53 |
}; |
| 54 |
|
| 55 |
} |
| 56 |
|
| 57 |
#endif |