Commit ffcf8970 authored by darin's avatar darin

Reviewed by John.

	- changes inspired by things I noticed reviewing diffs vs. KDE when preparing the tarball

        * kjs/function.cpp: (GlobalFuncImp::call): Use strtol when strtoll is
	not available. Do #ifndef NDEBUG, not #if !NDEBUG.
        * kjs/function.h: Do #ifndef NDEBUG, not #if !NDEBUG.
        * kjs/internal.cpp:
        (InterpreterImp::initGlobalObject): Do #ifndef NDEBUG, not #if !NDEBUG.
        (KJS::printInfo): Remove case for ListType and remove default case that just
	ends up suppressing the "missing case" warning and does no good.
        * kjs/interpreter.cpp: (Interpreter::evaluate): Do #ifndef NDEBUG, not #if !NDEBUG.
        * kjs/nodes.cpp:
        (Node::finalCheck): Fix accidentally-deleted code in an ifdef we never compile.
        (FunctionCallNode::evaluate): Remove bogus XXX comment. Maciej put this comment in,
        and together we determined it's not needed.
        (TypeOfNode::evaluate): Ditto.
        * kjs/object.cpp: Remove assert that refers to ListType.
        * kjs/value.h: Remove ListType.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3306 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d8d3bd9d
2003-01-11 Darin Adler <darin@apple.com>
Reviewed by John.
- changes inspired by things I noticed reviewing diffs vs. KDE when preparing the tarball
* kjs/function.cpp: (GlobalFuncImp::call): Use strtol when strtoll is
not available. Do #ifndef NDEBUG, not #if !NDEBUG.
* kjs/function.h: Do #ifndef NDEBUG, not #if !NDEBUG.
* kjs/internal.cpp:
(InterpreterImp::initGlobalObject): Do #ifndef NDEBUG, not #if !NDEBUG.
(KJS::printInfo): Remove case for ListType and remove default case that just
ends up suppressing the "missing case" warning and does no good.
* kjs/interpreter.cpp: (Interpreter::evaluate): Do #ifndef NDEBUG, not #if !NDEBUG.
* kjs/nodes.cpp:
(Node::finalCheck): Fix accidentally-deleted code in an ifdef we never compile.
(FunctionCallNode::evaluate): Remove bogus XXX comment. Maciej put this comment in,
and together we determined it's not needed.
(TypeOfNode::evaluate): Ditto.
* kjs/object.cpp: Remove assert that refers to ListType.
* kjs/value.h: Remove ListType.
2003-01-09 Darin Adler <darin@apple.com>
* JavaScriptCore.pbproj/project.pbxproj: Add the year 2003, remove CFBundleIconFile,
......
2003-01-11 Darin Adler <darin@apple.com>
Reviewed by John.
- changes inspired by things I noticed reviewing diffs vs. KDE when preparing the tarball
* kjs/function.cpp: (GlobalFuncImp::call): Use strtol when strtoll is
not available. Do #ifndef NDEBUG, not #if !NDEBUG.
* kjs/function.h: Do #ifndef NDEBUG, not #if !NDEBUG.
* kjs/internal.cpp:
(InterpreterImp::initGlobalObject): Do #ifndef NDEBUG, not #if !NDEBUG.
(KJS::printInfo): Remove case for ListType and remove default case that just
ends up suppressing the "missing case" warning and does no good.
* kjs/interpreter.cpp: (Interpreter::evaluate): Do #ifndef NDEBUG, not #if !NDEBUG.
* kjs/nodes.cpp:
(Node::finalCheck): Fix accidentally-deleted code in an ifdef we never compile.
(FunctionCallNode::evaluate): Remove bogus XXX comment. Maciej put this comment in,
and together we determined it's not needed.
(TypeOfNode::evaluate): Ditto.
* kjs/object.cpp: Remove assert that refers to ListType.
* kjs/value.h: Remove ListType.
2003-01-09 Darin Adler <darin@apple.com>
* JavaScriptCore.pbproj/project.pbxproj: Add the year 2003, remove CFBundleIconFile,
......
......@@ -483,7 +483,7 @@ Value GlobalFuncImp::call(ExecState *exec, Object &/*thisObj*/, const List &args
long long llValue = strtoll(cstr.c_str(), &endptr, radix);
double value = llValue;
#else
long value = strtoll(cstr.c_str(), &endptr, radix);
long value = strtol(cstr.c_str(), &endptr, radix);
#endif
if (errno != 0 || endptr == cstr.c_str())
res = Number(NaN);
......@@ -545,7 +545,7 @@ Value GlobalFuncImp::call(ExecState *exec, Object &/*thisObj*/, const List &args
res = String(s);
break;
}
#if !NDEBUG
#ifndef NDEBUG
case KJSPrint: {
UString str = args[0].toString(exec);
puts(str.ascii());
......
......@@ -128,7 +128,7 @@ namespace KJS {
virtual Value call(ExecState *exec, Object &thisObj, const List &args);
virtual CodeType codeType() const;
enum { Eval, ParseInt, ParseFloat, IsNaN, IsFinite, Escape, UnEscape
#if !NDEBUG
#ifndef NDEBUG
, KJSPrint
#endif
};
......
......@@ -648,7 +648,7 @@ void InterpreterImp::initGlobalObject()
global.put(globExec,"isFinite", Object(new GlobalFuncImp(globExec,funcProto,GlobalFuncImp::IsFinite, 1)), DontEnum);
global.put(globExec,"escape", Object(new GlobalFuncImp(globExec,funcProto,GlobalFuncImp::Escape, 1)), DontEnum);
global.put(globExec,"unescape", Object(new GlobalFuncImp(globExec,funcProto,GlobalFuncImp::UnEscape, 1)), DontEnum);
#if !NDEBUG
#ifndef NDEBUG
global.put(globExec,"kjsprint", Object(new GlobalFuncImp(globExec,funcProto,GlobalFuncImp::KJSPrint, 1)), DontEnum);
#endif
......@@ -896,11 +896,6 @@ void KJS::printInfo(ExecState *exec, const char *s, const Value &o, int lineno)
if (name.isNull())
name = "(unknown class)";
break;
case ListType:
name = "List";
break;
default:
break;
}
UString vString = v.toString(exec);
if ( vString.size() > 50 )
......
......@@ -113,7 +113,7 @@ bool Interpreter::checkSyntax(const UString &code)
Completion Interpreter::evaluate(const UString &code, const Value &thisV)
{
Completion comp = rep->evaluate(code,thisV);
#if !NDEBUG
#ifndef NDEBUG
if (comp.complType() == Throw) {
lock();
ExecState *exec = rep->globalExec();
......
......@@ -115,6 +115,8 @@ Reference Node::evaluateReference(ExecState *exec)
void Node::finalCheck()
{
fprintf( stderr, "Node::finalCheck(): list count : %d\n", (int)s_nodes.size() );
std::list<Node *>::iterator it = s_nodes->begin();
for ( uint i = 0; it != s_nodes->end() ; ++it, ++i )
fprintf( stderr, "[%d] Still having node %p (%s) (refcount %d)\n", i, (void*)*it, typeid( **it ).name(), (*it)->refcount );
delete s_nodes;
s_nodes = 0L;
......@@ -727,7 +729,6 @@ Value FunctionCallNode::evaluate(ExecState *exec)
#endif
Value thisVal;
// XXX - should check for constant reference
if (ref.isMutable())
thisVal = ref.getBase(exec);
else
......@@ -861,7 +862,6 @@ Value TypeOfNode::evaluate(ExecState *exec)
const char *s = 0L;
Reference ref = expr->evaluateReference(exec);
KJS_CHECKEXCEPTIONVALUE
// XXX - Really should check if this is a constant reference
if (ref.isMutable()) {
Value b = ref.getBase(exec);
if (b.type() == NullType)
......
......@@ -163,7 +163,6 @@ void ObjectImp::put(ExecState *exec, const Identifier &propertyName,
const Value &value, int attr)
{
assert(!value.isNull());
assert(value.type() != ListType);
// non-standard netscape extension
if (propertyName == specialPrototypePropertyName) {
......
......@@ -76,8 +76,7 @@ namespace KJS {
BooleanType = 3,
StringType = 4,
NumberType = 5,
ObjectType = 6,
ListType = 8
ObjectType = 6
};
/**
......@@ -184,8 +183,7 @@ namespace KJS {
/**
* Returns the type of value. This is one of UndefinedType, NullType,
* BooleanType, StringType NumberType, ObjectType or
* ListType.
* BooleanType, StringType, NumberType, or ObjectType.
*
* @return The type of value
*/
......
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