Ignore:
Timestamp:
Sep 28, 2005, 11:51:15 AM (20 years ago)
Author:
darin
Message:

Reviewed by Maciej.

  • update grammar to fix conflicts; fixes one of our test cases because it resolves the relationship between function expressions and declarations in the way required by the ECMA specification
  • kjs/grammar.y: Added lots of new grammar rules so we have no conflicts. A new set of rules for "no bracket or function at start of expression" and another set of rules for "no in anywhere in expression". Also simplified the handling of try to use only a single node and used operator precedence to get rid of the conflict in handling of if and else. Also used a macro to streamline the handling of automatic semicolons and changed parenthesis handling to use a virtual function.
  • kjs/nodes.h: Added nodeInsideAllParens, removed unused abortStatement. (KJS::TryNode::TryNode): Updated to hold catch and finally blocks directly instead of using a special node for each.
  • kjs/nodes.cpp: (Node::createErrorCompletion): Added. Used instead of throwError when creating errors that should not be in a completion rather than an ExecState. (Node::throwUndefinedVariableError): Added. Sets source location unlike the call it replaces. (Node::nodeInsideAllParens): Added. (GroupNode::nodeInsideAllParens): Added. (StatListNode::execute): Removed code to move exceptions into completion objects; that's now done solely by the KJS_CHECKEXCEPTION macro. (TryNode::execute): Include execution of catch and finally here rather than using separate nodes. (FuncDeclNode::execute): Moved here, no longer inline.
  • kjs/nodes2string.cpp: (TryNode::streamTo): Updated for change. (FuncDeclNode::streamTo): Ditto. (FuncExprNode::streamTo): Ditto.
  • kjs/kjs-test: Removed. Was part of "make check".
  • kjs/kjs-test.chk: Ditto.
  • kjs/test.js: Ditto.
  • tests/mozilla/expected.html: Updated because one more test succeeds.
File:
1 edited

Legend:

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

    r10634 r10646  
    1 // -*- c-basic-offset: 2 -*-
    21/*
    32 *  This file is part of the KDE libraries
     
    665664}
    666665
    667 void CatchNode::streamTo(SourceStream &s) const
    668 {
    669   s << SourceStream::Endl << "catch (" << ident << ")" << block;
    670 }
    671 
    672 void FinallyNode::streamTo(SourceStream &s) const
    673 {
    674   s << SourceStream::Endl << "finally " << block;
    675 }
    676 
    677666void TryNode::streamTo(SourceStream &s) const
    678667{
    679   s << "try " << block
    680     << _catch
    681     << _final;
     668  s << "try " << tryBlock;
     669  if (catchBlock)
     670    s << SourceStream::Endl << "catch (" << exceptionIdent << ")" << catchBlock;
     671  if (finallyBlock)
     672    s << SourceStream::Endl << "finally " << finallyBlock;
    682673}
    683674
     
    689680}
    690681
    691 void FuncDeclNode::streamTo(SourceStream &s) const {
    692   s << "function " << ident << "(";
    693   if (param)
    694     s << param;
    695   s << ")" << body;
     682void FuncDeclNode::streamTo(SourceStream &s) const
     683{
     684  s << "function " << ident << "(" << param << ")" << body;
    696685}
    697686
    698687void FuncExprNode::streamTo(SourceStream &s) const
    699688{
    700   s << "function " << "("
    701     << param
    702     << ")" << body;
     689  s << "function " << ident << "(" << param << ")" << body;
    703690}
    704691
     
    708695    s << n->element;
    709696}
    710 
Note: See TracChangeset for help on using the changeset viewer.