Ignore:
Timestamp:
Dec 16, 2005, 12:08:23 AM (19 years ago)
Author:
darin
Message:

JavaScriptCore:

Reviewed by Maciej.

  • kjs/internal.h:
  • kjs/internal.cpp: (KJS::InterpreterImp::evaluate): Change to take a character pointer and length rather than a UString.
  • kjs/interpreter.h:
  • kjs/interpreter.cpp: (Interpreter::evaluate): Ditto.
  • kjs/protect.h: Remove uneeded "convert to bool" operator since we already have a "convert to raw pointer" operator in this class.

WebCore:

Reviewed by Maciej.

  • khtml/ecma/kjs_dom.cpp: (KJS::DOMNode::getListener): Use listenerObj instead of listenerObjImp.
  • khtml/ecma/kjs_html.cpp: (KJS::Image::getValueProperty): Ditto.
  • khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::getValueProperty): Ditto.
  • khtml/ecma/kjs_window.h:
  • khtml/ecma/kjs_window.cpp: (KJS::Window::getListener): Ditto. (KJS::Window::getJSLazyEventListener): Take code as a DOMString, not QString.
  • khtml/ecma/kjs_events.cpp: (KJS::jsStringOrUndefined): Renamed function and moved it to the top of the file. (KJS::JSAbstractEventListener::handleEvent): Cleaned up function, removed double logging, and fixed code path to not use UString::ascii(). (KJS::JSUnprotectedEventListener::JSUnprotectedEventListener): Updated since type of the window object is now Window. (KJS::JSUnprotectedEventListener::~JSUnprotectedEventListener): Ditto. (KJS::JSUnprotectedEventListener::windowObj): Ditto. (KJS::JSEventListener::JSEventListener): Ditto. (KJS::JSEventListener::~JSEventListener): Ditto. (KJS::JSEventListener::windowObj): Ditto. (KJS::JSLazyEventListener::JSLazyEventListener): Ditto. Also changed code to be a DOMString instead of a QString. (KJS::JSLazyEventListener::handleEvent): Removed function because the base class handleEvent already calls listenerObj which takes care of parseCode -- no need to do an additional parseCode here. (KJS::JSLazyEventListener::parseCode): Rearrange and clean up a bit. Code is now a DOMString instead of a QString. (KJS::Clipboard::Clipboard): Remove explicit ref since we now use a RefPtr for the clipboard object. (KJS::Clipboard::getValueProperty): Update to call jsStringOrUndefined.
  • khtml/ecma/kjs_events.h: Reformatted the file. Changed windowObj functions to return Window* instead of ObjectImp*. Removed listenerObjImp function. Removed destructors from many classes that don't need them. Used a RefPtr for the ClipboardImpl in a Clipboard object.
  • khtml/ecma/kjs_proxy.h:
  • khtml/ecma/kjs_proxy.cpp: (KJSProxyImpl::evaluate): Take filename and code as DOMString instead of QString. (KJSProxyImpl::createHTMLEventHandler): Take URL and code as DOMString.
  • khtml/xml/dom_docimpl.h:
  • khtml/xml/dom_docimpl.cpp: (DocumentImpl::createHTMLEventListener): Take a DOMString rather than a QString for the JavaScript code. (DocumentImpl::setHTMLWindowEventListener): Added an overload that takes an attribute pointer. Calls through after extracting the code from the attribute value.
  • khtml/html/html_elementimpl.h:
  • khtml/html/html_elementimpl.cpp: (HTMLElementImpl::setHTMLEventListener): New version of function that takes an attribute pointer; calls through to the base class after extracting the code from the attribute value.
  • khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseMappedAttribute): Change to use new setHTMLWindowEventListener and setHTMLEventListener that takes an attribute pointer. (HTMLFrameElementImpl::parseMappedAttribute): Ditto. (HTMLFrameSetElementImpl::parseMappedAttribute): Ditto.
  • khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseMappedAttribute): Ditto.
  • khtml/html/html_formimpl.cpp: (DOM::HTMLFormElementImpl::parseMappedAttribute): Ditto. (DOM::HTMLButtonElementImpl::parseMappedAttribute): Ditto. (DOM::HTMLInputElementImpl::parseMappedAttribute): Ditto. (DOM::HTMLLabelElementImpl::parseMappedAttribute): Ditto. (DOM::HTMLSelectElementImpl::parseMappedAttribute): Ditto. (DOM::HTMLTextAreaElementImpl::parseMappedAttribute): Ditto.
  • khtml/html/html_imageimpl.cpp: (DOM::HTMLImageElementImpl::parseMappedAttribute): Ditto.
  • khtml/html/html_objectimpl.cpp: (DOM::HTMLObjectElementImpl::parseMappedAttribute): Ditto.
  • khtml/html/html_headimpl.h:
  • khtml/html/html_headimpl.cpp: (HTMLScriptElementImpl::notifyFinished): Don't convert URL to QString since we now take a DOMString. (HTMLScriptElementImpl::evaluateScript): Change to take script as a DOMString.
  • khtml/khtml_part.h:
  • khtml/khtml_part.cpp: (KHTMLPart::createHTMLEventListener): Take a DOMString rather than a QString for the JavaScript code.
  • kwq/WebCoreScriptDebugger.mm: (-[WebCoreScriptCallFrame evaluateWebScript:]): Change code path so it doesn't convert an NSString to UTF-8 to get it into the JavaScript machinery. Use QString::fromNSString instead for now.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/interpreter.h

    r11527 r11614  
    204204     * @return A completion object representing the result of the execution.
    205205     */
    206     Completion evaluate(const UString &sourceURL, int startingLineNumber, const UString &code, JSValue *thisV = NULL);
    207 
    208         // Overload of evaluate to keep JavaScriptGlue both source and binary compatible.
    209         Completion evaluate(const UString &code, JSValue *thisV = NULL, const UString &sourceFilename = UString());
     206    Completion evaluate(const UString& sourceURL, int startingLineNumber, const UChar* code, int codeLength, JSValue* thisV = 0);
     207    Completion evaluate(const UString& sourceURL, int startingLineNumber, const UString& code, JSValue* thisV = 0);
    210208
    211209    /**
     
    360358#endif
    361359
    362 #if APPLE_CHANGES
    363360    static bool shouldPrintExceptions();
    364361    static void setShouldPrintExceptions(bool);
    365 #endif
    366362
    367363    void saveBuiltins (SavedBuiltins &) const;
    368364    void restoreBuiltins (const SavedBuiltins &);
    369365
    370 #if APPLE_CHANGES
    371366    /**
    372367     * Determine if the value is a global object (for any interpreter).  This may
     
    395390    virtual bool isSafeScript (const Interpreter *target) { return true; }
    396391   
    397     virtual void *createLanguageInstanceForValue (ExecState *exec, int language, JSObject *value, const Bindings::RootObject *origin, const Bindings::RootObject *current);
    398 #endif
     392    virtual void *createLanguageInstanceForValue(ExecState*, int language, JSObject* value, const Bindings::RootObject* origin, const Bindings::RootObject* current);
    399393
    400394    // This is a workaround to avoid accessing the global variables for these identifiers in
     
    435429    friend class InterpreterImp;
    436430    friend class FunctionImp;
    437 #if APPLE_CHANGES
    438     friend class RuntimeMethod;
    439 #endif
    440 
     431    friend class RuntimeMethodImp;
    441432    friend class GlobalFuncImp;
    442433  public:
     
    466457    Context context() const { return _context; }
    467458
    468     void setException(JSValue *e) { _exception = e; }
    469     void clearException() { _exception = NULL; }
    470     JSValue *exception() const { return _exception; }
     459    void setException(JSValue* e) { _exception = e; }
     460    void clearException() { _exception = 0; }
     461    JSValue* exception() const { return _exception; }
    471462    bool hadException() const { return _exception; }
    472463
    473464  private:
    474     ExecState(Interpreter *interp, ContextImp *con)
    475         : _interpreter(interp), _context(con), _exception(NULL) { }
    476     Interpreter *_interpreter;
    477     ContextImp *_context;
    478     JSValue *_exception;
     465    ExecState(Interpreter* interp, ContextImp* con)
     466        : _interpreter(interp), _context(con), _exception(0) { }
     467    Interpreter* _interpreter;
     468    ContextImp* _context;
     469    JSValue* _exception;
    479470  };
    480471
Note: See TracChangeset for help on using the changeset viewer.