Ignore:
Timestamp:
Jul 21, 2002, 10:38:39 PM (23 years ago)
Author:
darin
Message:

JavaScriptCore:

  • kjs/*: Roll KDE 3.0.2 changes in. Also switch to not using APPLE_CHANGES for some of the changes that we definitely want to contribute upstream.

WebCore:

  • khtml/*: Roll KDE 3.0.2 changes in. Also switch to not using APPLE_CHANGES for some of the changes that we definitely want to contribute upstream.
  • WebCore.pbproj/project.pbxproj: Add KWQStyle.mm, remove KWQStyle.h, moving contents into qstyle.h.
  • kwq/KWQApplication.mm: (QApplication::globalStrut): Remove _logNotYetImplemented().
  • kwq/KWQButton.mm: (QButton::QButton): Use plain release, not autorelease.
  • kwq/KWQComboBox.mm: (QComboBox::init): Use plain release, not autorelease.
  • kwq/KWQListBox.mm: (QListBox::QListBox): Use plain release, not autorelease.
  • kwq/KWQPainter.mm: (QPainter::drawArc): Use plain release, not autorelease.
  • kwq/KWQKHTMLPartBrowserExtension.mm: Remove import of KWQKHTMLPartImpl.h, now that it's always part of khtml_part.h.
  • kwq/KWQKHTMLPartImpl.cpp: Simplify.
  • kwq/KWQKHTMLPartImpl.h: Add wrapper to allow multiple inclusion. Don't include khtml_part.h any more, since that file now includes this one to minimize changes to KDE code that needs to get to functions in here.
  • kwq/KWQKHTMLPartImpl.mm: (KHTMLPart::onURL), (KHTMLPart::nodeActivated), (KHTMLPart::setStatusBarText): Moved here from khtml_part.cpp.
  • kwq/KWQLoaderImpl.mm: Include khtml_part.h instead of KWQKHTMLPartImpl.h.
  • kwq/KWQPushButton.mm: (buttonFontMetrics), (QPushButton::fontMetrics): Added. Used by the form code to size buttons.
  • kwq/KWQStyle.mm: Added. (QStyle::sizeFromContents): Added. Used by the form code to size buttons.
  • kwq/KWQStyle.h: Removed.
  • kwq/qt/qstyle.h: Moved contents of KWQStyle.h in here.
  • kwq/qt/qwidget.h: Include <qstyle.h> rather than KWQStyle.h.
  • kwq/WebCoreBridge.mm: (-[WebCoreBridge isFrameSet]): Call straight to impl.
  • kwq/kdeui/klineedit.h: Add KLineEdit::frameWidth().
  • kwq/qt/qnamespace.h: Remove GUIStyle, MacStyle, and WindowsStyle.
  • kwq/qt/qpaintdevice.h: Add QInternal, QInternal::Printer, and QPaintDevice::devType().
  • kwq/qt/qpainter.h: Add QPainter::device().
  • kwq/qt/qpushbutton.h: Add QPushButton::fontMetrics().
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/function.cpp

    r1326 r1623  
    22/*
    33 *  This file is part of the KDE libraries
    4  *  Copyright (C) 1999-2000 Harri Porten ([email protected])
     4 *  Copyright (C) 1999-2002 Harri Porten ([email protected])
    55 *  Copyright (C) 2001 Peter Kelly ([email protected])
    66 *
     
    3232
    3333#include <stdio.h>
     34#include <errno.h>
     35#include <stdlib.h>
    3436#include <assert.h>
    3537#include <string.h>
     
    3739using namespace KJS;
    3840
    39 // ------------------------------ FunctionImp ----------------------------------
     41// ----------------------------- FunctionImp ----------------------------------
    4042
    4143const ClassInfo FunctionImp::info = {"Function", &InternalFunctionImp::info, 0, 0};
     
    100102
    101103    Object func(this);
    102     int cont = dbg->callEvent(exec,sid,lineno,func,args);
     104    bool cont = dbg->callEvent(exec,sid,lineno,func,args);
    103105    if (!cont) {
    104106      dbg->imp()->abort();
     
    108110
    109111  // enter a new execution context
    110   ContextImp *ctx = new ContextImp(globalObj, exec, thisObj,
    111                                    codeType(), exec->context().imp(), this, args);
    112   ExecState *newExec = new ExecState(exec->interpreter(),ctx);
    113   newExec->setException(exec->exception()); // could be null
     112  ContextImp ctx(globalObj, exec, thisObj, codeType(),
     113                 exec->context().imp(), this, args);
     114  ExecState newExec(exec->interpreter(), &ctx);
     115  newExec.setException(exec->exception()); // could be null
    114116
    115117  // In order to maintain our "arguments" property, we maintain a list of arguments
     
    118120  // Note: this does not appear to be part of the spec
    119121  if (codeType() == FunctionCode) {
    120     assert(ctx->activationObject().inherits(&ActivationImp::info));
    121     Object argsObj = static_cast<ActivationImp*>(ctx->activationObject().imp())->argumentsObject();
    122     put(newExec,"arguments", argsObj, DontDelete|DontEnum|ReadOnly);
    123     pushArgs(newExec,argsObj);
     122    assert(ctx.activationObject().inherits(&ActivationImp::info));
     123    Object argsObj = static_cast<ActivationImp*>(ctx.activationObject().imp())->argumentsObject();
     124    put(&newExec, "arguments", argsObj, DontDelete|DontEnum|ReadOnly);
     125    pushArgs(&newExec, argsObj);
    124126  }
    125127
    126128  // assign user supplied arguments to parameters
    127   processParameters(newExec,args);
     129  processParameters(&newExec, args);
    128130  // add variable declarations (initialized to undefined)
    129   processVarDecls(newExec);
    130 
    131   Completion comp = execute(newExec);
     131  processVarDecls(&newExec);
     132
     133  Completion comp = execute(&newExec);
    132134
    133135  // if an exception occured, propogate it back to the previous execution object
    134   if (newExec->hadException())
    135     exec->setException(newExec->exception());
     136  if (newExec.hadException())
     137    exec->setException(newExec.exception());
    136138  if (codeType() == FunctionCode)
    137     popArgs(newExec);
    138   delete newExec;
    139   delete ctx;
     139    popArgs(&newExec);
    140140
    141141#ifdef KJS_VERBOSE
     
    431431  }
    432432  case ParseInt: {
    433     String str = args[0].toString(exec);
     433    CString cstr = args[0].toString(exec).cstring();
    434434    int radix = args[1].toInt32(exec);
    435     if (radix == 0)
    436       radix = 10;
    437     else if (radix < 2 || radix > 36) {
     435
     436    char* endptr;
     437    errno = 0;
     438    long value = strtol(cstr.c_str(), &endptr, radix);
     439    if (errno != 0 || endptr == cstr.c_str())
    438440      res = Number(NaN);
    439       return res;
    440     }
    441     /* TODO: use radix */
    442     // Can't use toULong(), we want to accept floating point values too
    443     double value = str.value().toDouble( true /*tolerant*/ );
    444     if ( isNaN(value) )
    445         res = Number(NaN);
    446441    else
    447         res = Number(static_cast<long>(value)); // remove floating-point part
    448     break;
    449   }
    450   case ParseFloat: {
    451     String str = args[0].toString(exec);
    452     res = Number(str.value().toDouble( true /*tolerant*/ ));
    453     break;
    454   }
     442      res = Number(value);
     443    break;
     444  }
     445  case ParseFloat:
     446    res = Number(args[0].toString(exec).toDouble( true /*tolerant*/ ));
     447    break;
    455448  case IsNaN:
    456449    res = Boolean(isNaN(args[0].toNumber(exec)));
    457450    break;
    458451  case IsFinite: {
    459     Number n = args[0].toNumber(exec);
    460     res = Boolean(!n.isNaN() && !n.isInf());
     452    double n = args[0].toNumber(exec);
     453    res = Boolean(!isNaN(n) && !isInf(n));
    461454    break;
    462455  }
     
    485478    UString s, str = args[0].toString(exec);
    486479    int k = 0, len = str.size();
     480    UChar u;
    487481    while (k < len) {
    488482      const UChar *c = str.data() + k;
    489       UChar u;
    490483      if (*c == UChar('%') && k <= len - 6 && *(c+1) == UChar('u')) {
    491484        u = Lexer::convertUnicode((c+2)->unicode(), (c+3)->unicode(),
Note: See TracChangeset for help on using the changeset viewer.