Ignore:
Timestamp:
Nov 3, 2011, 5:02:05 AM (14 years ago)
Author:
[email protected]
Message:

Web Inspector: preserve script location for inline handlers.
https://bugs.webkit.org/show_bug.cgi?id=71367

Source/JavaScriptCore:

Makes SourceCode factories receive TextPosition instead of the line number;
Stores consistent position values in SourceCode and SourceProvider;

Patch by Pavel Feldman <[email protected]> on 2011-11-03
Reviewed by Yury Semikhatsky.

  • API/JSBase.cpp:

(JSEvaluateScript):
(JSCheckScriptSyntax):

  • API/JSObjectRef.cpp:

(JSObjectMakeFunction):

  • parser/SourceCode.h:

(JSC::makeSource):

  • parser/SourceProvider.h:

(JSC::SourceProvider::SourceProvider):
(JSC::SourceProvider::startPosition):
(JSC::UStringSourceProvider::create):
(JSC::UStringSourceProvider::UStringSourceProvider):

  • runtime/FunctionConstructor.cpp:

(JSC::constructFunction):
(JSC::constructFunctionSkippingEvalEnabledCheck):

  • runtime/FunctionConstructor.h:

Source/WebCore:

Makes eventHandler report position, not line number;

Patch by Pavel Feldman <[email protected]> on 2011-11-03
Reviewed by Yury Semikhatsky.

  • bindings/js/CachedScriptSourceProvider.h:

(WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):

  • bindings/js/JSLazyEventListener.cpp:

(WebCore::JSLazyEventListener::JSLazyEventListener):
(WebCore::JSLazyEventListener::initializeJSFunction):

  • bindings/js/JSLazyEventListener.h:

(WebCore::JSLazyEventListener::create):

  • bindings/js/ScriptController.cpp:

(WebCore::ScriptController::eventHandlerPosition):

  • bindings/js/ScriptController.h:
  • bindings/js/ScriptEventListener.cpp:

(WebCore::createAttributeEventListener):

  • bindings/js/ScriptSourceProvider.h:

(WebCore::ScriptSourceProvider::ScriptSourceProvider):

  • bindings/js/StringSourceProvider.h:

(WebCore::StringSourceProvider::create):
(WebCore::StringSourceProvider::StringSourceProvider):
(WebCore::makeSource):

LayoutTests:

Linkifier test reimplemented for simplisity.

Patch by Pavel Feldman <[email protected]> on 2011-11-03
Reviewed by Yury Semikhatsky.

  • inspector/debugger/debugger-scripts-expected.txt:
  • inspector/debugger/debugger-scripts.html:
  • inspector/debugger/linkifier-expected.txt:
  • inspector/debugger/linkifier.html:
  • platform/chromium/inspector/debugger/debugger-scripts-expected.txt: Copied from LayoutTests/inspector/debugger/debugger-scripts-expected.txt.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSBase.cpp

    r94811 r99167  
    5151    // evaluate sets "this" to the global object if it is NULL
    5252    JSGlobalObject* globalObject = exec->dynamicGlobalObject();
    53     SourceCode source = makeSource(script->ustring(), sourceURL->ustring(), startingLineNumber);
     53    SourceCode source = makeSource(script->ustring(), sourceURL->ustring(), TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber::first()));
    5454
    5555    JSValue evaluationException;
     
    7474    APIEntryShim entryShim(exec);
    7575
    76     SourceCode source = makeSource(script->ustring(), sourceURL->ustring(), startingLineNumber);
     76    SourceCode source = makeSource(script->ustring(), sourceURL->ustring(), TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber::first()));
    7777   
    7878    JSValue syntaxException;
Note: See TracChangeset for help on using the changeset viewer.