Ignore:
Timestamp:
Jul 18, 2008, 6:44:24 PM (17 years ago)
Author:
[email protected]
Message:

Bug 18774: SQUIRRELFISH: print meaningful error messages <https://bugs.webkit.org/show_bug.cgi?id=18774>
<rdar://problem/5769353> SQUIRRELFISH: JavaScript error messages are missing informative text

Reviewed by Cameron Zwarich

Add support for decent error messages in JavaScript. This patch achieves this by providing
ensuring the common errors and exceptions have messages that provide the text of expression
that trigger the exception. In addition it attaches a number of properties to the exception
object detailing where in the source the expression came from.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/VM/CodeGenerator.cpp

    r35231 r35245  
    850850}
    851851
    852 RegisterID* CodeGenerator::emitCall(RegisterID* dst, RegisterID* func, RegisterID* base, ArgumentsNode* argumentsNode)
    853 {
    854     return emitCall(op_call, dst, func, base, argumentsNode);
    855 }
    856 
    857 RegisterID* CodeGenerator::emitCallEval(RegisterID* dst, RegisterID* func, RegisterID* base, ArgumentsNode* argumentsNode)
    858 {
    859     return emitCall(op_call_eval, dst, func, base, argumentsNode);
    860 }
    861 
    862 RegisterID* CodeGenerator::emitCall(OpcodeID opcodeID, RegisterID* dst, RegisterID* func, RegisterID* base, ArgumentsNode* argumentsNode)
     852RegisterID* CodeGenerator::emitCall(RegisterID* dst, RegisterID* func, RegisterID* base, ArgumentsNode* argumentsNode, unsigned divot, unsigned startOffset, unsigned endOffset)
     853{
     854    return emitCall(op_call, dst, func, base, argumentsNode, divot, startOffset, endOffset);
     855}
     856
     857RegisterID* CodeGenerator::emitCallEval(RegisterID* dst, RegisterID* func, RegisterID* base, ArgumentsNode* argumentsNode, unsigned divot, unsigned startOffset, unsigned endOffset)
     858{
     859    return emitCall(op_call_eval, dst, func, base, argumentsNode, divot, startOffset, endOffset);
     860}
     861
     862RegisterID* CodeGenerator::emitCall(OpcodeID opcodeID, RegisterID* dst, RegisterID* func, RegisterID* base, ArgumentsNode* argumentsNode, unsigned divot, unsigned startOffset, unsigned endOffset)
    863863{
    864864    ASSERT(opcodeID == op_call || opcodeID == op_call_eval);
     
    883883    }
    884884
     885    emitExpressionInfo(divot, startOffset, endOffset);
    885886    emitOpcode(opcodeID);
    886887    instructions().append(dst->index());
Note: See TracChangeset for help on using the changeset viewer.