Ignore:
Timestamp:
Aug 17, 2015, 3:57:23 PM (10 years ago)
Author:
[email protected]
Message:

Web Inspector: Type profiler return types aren't showing up
https://bugs.webkit.org/show_bug.cgi?id=147348

Patch by Saam barati <[email protected]> on 2015-08-17
Reviewed by Brian Burg.

Bug #145995 changed the starting offset of a function to
be the open parenthesis of the function's parameter list.
Source/JavaScriptCore:

This broke JSC's type profiler protocol of communicating
return types of a function to the web inspector. This
is now fixed. The text offset used in the protocol is now
the first letter of the function/get/set/method name.
So "f" in "function a() {}", "s" in "set foo(){}", etc.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::CodeBlock):

  • jsc.cpp:

(functionReturnTypeFor):

Source/WebInspectorUI:

This broke the type profiler's text offset based protocol with JSC.
The text offset used in the protocol is now the first letter of the
function/get/set/method name. So "f" in "function a() {}", "s" in "set foo(){}", etc.

  • UserInterface/Models/ScriptSyntaxTree.js:

(WebInspector.ScriptSyntaxTree.prototype.containsNonEmptyReturnStatement):
(WebInspector.ScriptSyntaxTree.functionReturnDivot):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jsc.cpp

    r188351 r188549  
    11511151    FunctionExecutable* executable = (jsDynamicCast<JSFunction*>(functionValue.asCell()->getObject()))->jsExecutable();
    11521152
    1153     unsigned offset = executable->source().startOffset();
     1153    unsigned offset = executable->typeProfilingStartOffset();
    11541154    String jsonString = exec->vm().typeProfiler()->typeInformationForExpressionAtOffset(TypeProfilerSearchDescriptorFunctionReturn, offset, executable->sourceID(), exec->vm());
    11551155    return JSValue::encode(JSONParse(exec, jsonString));
Note: See TracChangeset for help on using the changeset viewer.