Changeset 15026 in webkit for trunk/JavaScriptCore/kjs


Ignore:
Timestamp:
Jun 25, 2006, 10:53:03 AM (19 years ago)
Author:
thatcher
Message:

JavaScriptCore:

Reviewed by Darin.

Bug 9574: Drosera should show inline scripts within the original HTML
http://bugzilla.opendarwin.org/show_bug.cgi?id=9574

Pass the starting line number and error message to the debugger.

  • kjs/debugger.cpp: (Debugger::sourceParsed):
  • kjs/debugger.h:
  • kjs/function.cpp: (KJS::GlobalFuncImp::callAsFunction):
  • kjs/function_object.cpp: (FunctionObjectImp::construct):
  • kjs/interpreter.cpp: (KJS::Interpreter::evaluate):

WebCore:

Reviewed by Darin.

Bug 9574: Drosera should show inline scripts within the original HTML
http://bugzilla.opendarwin.org/show_bug.cgi?id=9574

  • Pass the starting line number and error message to the debugger.
  • Call parsedSource even if there was a script parse error so the debugger can show the parse error.
  • Pass NSURL objects to the ObjC delegate for the script URLs.
  • bridge/mac/WebCoreScriptDebugger.h:
  • bridge/mac/WebCoreScriptDebugger.mm: (toNSURL): (WebCoreScriptDebuggerImp::sourceParsed):

WebKit:

Reviewed by Darin.

Bug 9574: Drosera should show inline scripts within the original HTML
http://bugzilla.opendarwin.org/show_bug.cgi?id=9574

  • Adds a new version of the didParseSource delegate callback with base line number.
  • Adds a new delegate callback for when a script fails to parse.
  • These new callbacks use NSURLs for the url parameter.
  • Adds a new script listener callback to notify when the main resource loads.
  • Adds a WebScriptErrorDomian and other keys for use with NSError.
  • DefaultDelegates/WebDefaultScriptDebugDelegate.m: (-[WebDefaultScriptDebugDelegate webView:didParseSource:baseLineNumber:fromURL:sourceId:forWebFrame:]): (-[WebDefaultScriptDebugDelegate webView:failedToParseSource:baseLineNumber:fromURL:withError:forWebFrame:]):
  • DefaultDelegates/WebScriptDebugServer.h:
  • DefaultDelegates/WebScriptDebugServer.m: (-[WebScriptDebugServer webView:didLoadMainResourceForDataSource:]): (-[WebScriptDebugServer webView:didParseSource:baseLineNumber:fromURL:sourceId:forWebFrame:]): (-[WebScriptDebugServer webView:failedToParseSource:baseLineNumber:fromURL:withError:forWebFrame:]):
  • DefaultDelegates/WebScriptDebugServerPrivate.h:
  • WebKit.exp:
  • WebView/WebDataSource.m: (-[WebDataSource _setPrimaryLoadComplete:]):
  • WebView/WebScriptDebugDelegate.h:
  • WebView/WebScriptDebugDelegate.m: (-[WebScriptCallFrame parsedSource:fromURL:sourceId:startLine:errorLine:errorMessage:]):

WebKitTools:

Reviewed by Darin.

Bug 9574: Drosera should show inline scripts within the original HTML
http://bugzilla.opendarwin.org/show_bug.cgi?id=9574

Refactor the JavaScript code to have a distinction between files
and scripts. Show the script in the context of the HTML file if
it's URL is the same as the frame's main resource. At the time of
the disParseScript callback the main resource might not be completely
loaded, but Drosera needs to show whatever we have at the time. Once
the main resource is finished, update the file source and reload the file.

  • Drosera/DebuggerDocument.m: (-[DebuggerDocument pause]): (-[DebuggerDocument webView:didLoadMainResourceForDataSource:]): (-[DebuggerDocument webView:didParseSource:baseLineNumber:fromURL:sourceId:forWebFrame:]): (-[DebuggerDocument webView:failedToParseSource:baseLineNumber:fromURL:withError:forWebFrame:]):
  • Drosera/debugger.css:
  • Drosera/debugger.js:
Location:
trunk/JavaScriptCore/kjs
Files:
5 edited

Legend:

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

    r14896 r15026  
    8484
    8585bool Debugger::sourceParsed(ExecState */*exec*/, int /*sourceId*/, const UString &/*sourceURL*/,
    86                            const UString &/*source*/, int /*errorLine*/)
     86                           const UString &/*source*/, int /*startingLineNumber*/, int /*errorLine*/, const UString & /*errorMsg*/)
    8787{
    8888  return true;
  • trunk/JavaScriptCore/kjs/debugger.h

    r13017 r15026  
    104104     * @param sourceURL Where the source code that was parsed came from
    105105     * @param source The source code that was parsed
     106     * @param startingLineNumber The line number at which parsing started
    106107     * @param errorLine The line number at which parsing encountered an
    107108     * error, or -1 if the source code was valid and parsed successfully
     109     * @param errorMsg The error description, or null if the source code
     110       was valid and parsed successfully
    108111     * @return true if execution should be continue, false if it should
    109112     * be aborted
    110113     */
    111114    virtual bool sourceParsed(ExecState *exec, int sourceId, const UString &sourceURL,
    112                               const UString &source, int errorLine);
     115                              const UString &source, int startingLineNumber, int errorLine, const UString &errorMsg);
    113116
    114117    /**
  • trunk/JavaScriptCore/kjs/function.cpp

    r14900 r15026  
    796796        Debugger *dbg = exec->dynamicInterpreter()->debugger();
    797797        if (dbg) {
    798           bool cont = dbg->sourceParsed(exec, sid, UString(), s, errLine);
     798          bool cont = dbg->sourceParsed(exec, sid, UString(), s, 0, errLine, errMsg);
    799799          if (!cont)
    800800            return jsUndefined();
  • trunk/JavaScriptCore/kjs/function_object.cpp

    r14834 r15026  
    191191  if (dbg) {
    192192    // send empty sourceURL to indicate constructed code
    193     bool cont = dbg->sourceParsed(exec,sid,UString(),body,errLine);
     193    bool cont = dbg->sourceParsed(exec, sid, UString(), body, lineNumber, errLine, errMsg);
    194194    if (!cont) {
    195195      dbg->imp()->abort();
  • trunk/JavaScriptCore/kjs/interpreter.cpp

    r14951 r15026  
    442442    // notify debugger that source has been parsed
    443443    if (m_debugger) {
    444         bool cont = m_debugger->sourceParsed(&m_globalExec, sid, sourceURL, UString(code, codeLength), errLine);
     444        bool cont = m_debugger->sourceParsed(&m_globalExec, sid, sourceURL, UString(code, codeLength), startingLineNumber, errLine, errMsg);
    445445        if (!cont)
    446446            return Completion(Break);
Note: See TracChangeset for help on using the changeset viewer.