Ignore:
Timestamp:
Oct 2, 2014, 8:15:03 AM (11 years ago)
Author:
[email protected]
Message:

Fixed the Inspector to be able to properly distinguish between scope types.
<https://webkit.org/b/137279>

Source/JavaScriptCore:

Reviewed by Geoffrey Garen.

The pre-existing code incorrectly labels Catch Scopes and Function Name Scopes
as With Scopes. This patch will fix this.

  • bytecode/BytecodeList.json:
  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::emitPushFunctionNameScope):
(JSC::BytecodeGenerator::emitPushCatchScope):

  • These now passes stores the desired JSNameScope::Type in a bytecode operand.
  • debugger/DebuggerScope.cpp:

(JSC::DebuggerScope::isCatchScope):
(JSC::DebuggerScope::isFunctionNameScope):

  • Added queries to be able to explicitly test if the scope is a CatchScope or FunctionNameScope. The FunctionNameScope is the case where the NameScope is used to capture the function name of a function expression.
  • debugger/DebuggerScope.h:
  • inspector/InjectedScriptSource.js:
  • inspector/JSJavaScriptCallFrame.cpp:

(Inspector::JSJavaScriptCallFrame::scopeType):

  • inspector/JSJavaScriptCallFrame.h:
  • inspector/JSJavaScriptCallFramePrototype.cpp:

(Inspector::JSJavaScriptCallFramePrototype::finishCreation):
(Inspector::jsJavaScriptCallFrameConstantFUNCTION_NAME_SCOPE):

  • inspector/protocol/Debugger.json:
  • jit/CCallHelpers.h:

(JSC::CCallHelpers::setupArgumentsWithExecState):

  • jit/JIT.h:
  • jit/JITInlines.h:

(JSC::JIT::callOperation):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_push_name_scope):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::emit_op_push_name_scope):

  • jit/JITOperations.cpp:
  • jit/JITOperations.h:
  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • llint/LowLevelInterpreter.asm:
  • runtime/JSFunction.cpp:

(JSC::JSFunction::addNameScopeIfNeeded):

  • runtime/JSNameScope.h:

(JSC::JSNameScope::create):
(JSC::JSNameScope::isFunctionNameScope):
(JSC::JSNameScope::isCatchScope):
(JSC::JSNameScope::JSNameScope):

  • Now stores the JSNameScope::Type in a field.

Source/WebInspectorUI:

Reviewed by Geoffrey Garen and Joseph Pecoraro.

  • Localizations/en.lproj/localizedStrings.js:
  • UserInterface/Controllers/DebuggerManager.js:
  • UserInterface/Models/ScopeChainNode.js:
  • UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
  • Added handling of the FunctionNameScope case.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/debugger/DebuggerScope.cpp

    r173896 r174216  
    2929#include "JSLexicalEnvironment.h"
    3030#include "JSCInlines.h"
     31#include "JSNameScope.h"
    3132#include "JSWithScope.h"
    3233
     
    155156}
    156157
     158bool DebuggerScope::isCatchScope() const
     159{
     160    return m_scope->isNameScopeObject() && reinterpret_cast<JSNameScope*>(m_scope.get())->isCatchScope();
     161}
     162
     163bool DebuggerScope::isFunctionNameScope() const
     164{
     165    return m_scope->isNameScopeObject() && reinterpret_cast<JSNameScope*>(m_scope.get())->isFunctionNameScope();
     166}
     167
    157168bool DebuggerScope::isWithScope() const
    158169{
Note: See TracChangeset for help on using the changeset viewer.