Commit f391063e authored by darin's avatar darin

Reviewed by Maciej.

        - got rid of some framework initialization (working on bug 2959353)

        * kjs/identifier.h: Turn Identifier:null into Identifier:null().
        * kjs/identifier.cpp: Removed Identifier:null and added Identifier:null().

        * kjs/internal.cpp: Made NaN_Bytes and Inf_Bytes const.

        * kjs/completion.h: Use Identifier:null() instead of Identifier:null.
        * kjs/function.h: Ditto.
        * kjs/function_object.cpp: (FunctionObjectImp::construct): Ditto.
        * kjs/nodes.cpp: (FuncExprNode::evaluate): Use Identifier:null() instead of Identifier:null.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3745 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e4728cae
2003-03-04 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- got rid of some framework initialization (working on bug 2959353)
* kjs/identifier.h: Turn Identifier:null into Identifier:null().
* kjs/identifier.cpp: Removed Identifier:null and added Identifier:null().
* kjs/internal.cpp: Made NaN_Bytes and Inf_Bytes const.
* kjs/completion.h: Use Identifier:null() instead of Identifier:null.
* kjs/function.h: Ditto.
* kjs/function_object.cpp: (FunctionObjectImp::construct): Ditto.
* kjs/nodes.cpp: (FuncExprNode::evaluate): Use Identifier:null() instead of Identifier:null.
2003-03-02 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
......
2003-03-04 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- got rid of some framework initialization (working on bug 2959353)
* kjs/identifier.h: Turn Identifier:null into Identifier:null().
* kjs/identifier.cpp: Removed Identifier:null and added Identifier:null().
* kjs/internal.cpp: Made NaN_Bytes and Inf_Bytes const.
* kjs/completion.h: Use Identifier:null() instead of Identifier:null.
* kjs/function.h: Ditto.
* kjs/function_object.cpp: (FunctionObjectImp::construct): Ditto.
* kjs/nodes.cpp: (FuncExprNode::evaluate): Use Identifier:null() instead of Identifier:null.
2003-03-02 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
......
......@@ -48,7 +48,7 @@ namespace KJS {
class Completion : private Value {
public:
Completion(ComplType c = Normal, const Value& v = Value(),
const Identifier &t = Identifier::null)
const Identifier &t = Identifier::null())
: comp(c), val(v), tar(t) { }
ComplType complType() const { return comp; }
......
......@@ -38,7 +38,7 @@ namespace KJS {
friend class Function;
friend class ActivationImp;
public:
FunctionImp(ExecState *exec, const Identifier &n = Identifier::null);
FunctionImp(ExecState *exec, const Identifier &n = Identifier::null());
virtual ~FunctionImp();
virtual Value get(ExecState *exec, const Identifier &propertyName) const;
......
......@@ -236,7 +236,7 @@ Object FunctionObjectImp::construct(ExecState *exec, const List &args)
scopeChain.push(exec->interpreter()->globalObject().imp());
FunctionBodyNode *bodyNode = progNode;
FunctionImp *fimp = new DeclaredFunctionImp(exec, Identifier::null, bodyNode,
FunctionImp *fimp = new DeclaredFunctionImp(exec, Identifier::null(), bodyNode,
scopeChain);
Object ret(fimp); // protect from GC
......
......@@ -43,8 +43,6 @@ IdentifierStatisticsExitLogger::~IdentifierStatisticsExitLogger()
#endif
Identifier Identifier::null;
extern const Identifier argumentsPropertyName("arguments");
extern const Identifier calleePropertyName("callee");
extern const Identifier constructorPropertyName("constructor");
......@@ -296,4 +294,10 @@ void Identifier::rehash(int newTableSize)
free(oldTable);
}
const Identifier &Identifier::null()
{
static Identifier null;
return null;
}
} // namespace KJS
......@@ -52,7 +52,7 @@ namespace KJS {
uint32_t toUInt32(bool *ok) const { return _ustring.toUInt32(ok); }
double toDouble() const { return _ustring.toDouble(); }
static Identifier null;
static const Identifier &null();
friend bool operator==(const Identifier &, const Identifier &);
friend bool operator!=(const Identifier &, const Identifier &);
......
......@@ -56,14 +56,14 @@ using namespace KJS;
namespace KJS {
#ifdef WORDS_BIGENDIAN
unsigned char NaN_Bytes[] = { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 };
unsigned char Inf_Bytes[] = { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 };
const unsigned char NaN_Bytes[] = { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 };
const unsigned char Inf_Bytes[] = { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 };
#elif defined(arm)
unsigned char NaN_Bytes[] = { 0, 0, 0xf8, 0x7f, 0, 0, 0, 0 };
unsigned char Inf_Bytes[] = { 0, 0, 0xf0, 0x7f, 0, 0, 0, 0 };
const unsigned char NaN_Bytes[] = { 0, 0, 0xf8, 0x7f, 0, 0, 0, 0 };
const unsigned char Inf_Bytes[] = { 0, 0, 0xf0, 0x7f, 0, 0, 0, 0 };
#else
unsigned char NaN_Bytes[] = { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f };
unsigned char Inf_Bytes[] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f };
const unsigned char NaN_Bytes[] = { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f };
const unsigned char Inf_Bytes[] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f };
#endif
const double NaN = *(const double*) NaN_Bytes;
......
......@@ -2833,7 +2833,7 @@ bool FuncExprNode::deref()
// ECMA 13
Value FuncExprNode::evaluate(ExecState *exec)
{
FunctionImp *fimp = new DeclaredFunctionImp(exec, Identifier::null, body, exec->context().imp()->scopeChain());
FunctionImp *fimp = new DeclaredFunctionImp(exec, Identifier::null(), body, exec->context().imp()->scopeChain());
Value ret(fimp);
List empty;
Value proto = exec->interpreter()->builtinObject().construct(exec,empty);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment