0 Replies Latest reply on Jun 25, 2008 9:53 AM by (Paul_Reilly)

    [svn] 2234: Fixes for fdbunit tests when AST generation is enabled.

      Revision: 2234
      Author: preilly@adobe.com
      Date: 2008-06-25 10:53:35 -0700 (Wed, 25 Jun 2008)

      Log Message:
      -----------
      Fixes for fdbunit tests when AST generation is enabled.

      tests Passed: checkintests, fdbunit tests (All, but four, three of
      which were failing before.)

      Needs QA: YES

      Needs DOC: NO

      Bug fixes: SDK-15781

      API Change: NO

      Reviewer: pfarland, tierney

      Code-level description of changes:

      asc/src/java/macromedia/asc/parser/InputBuffer.java

      Made line_breaks protected, so subclasses can prepopulate it.

      asc/src/java/macromedia/asc/embedding/avmplus/ActionBlockEmitter.java

      Modified setPosition() to set the linenum to -1 if the position is
      less than 1. This prevents actual line numbers from being reused
      by subsequent synthetic functions.

      compiler/src/java/flex2/compiler/as3/OffsetInputBuffer.java

      Modified constructor to prepopulate line_breaks with the offset.

      compiler/src/java/flex2/compiler/as3/AbstractSyntaxTreeUtil.java

      Modified generateConstructor() to take a "position" arg and to
      apply to the generated FunctionCommondNode.

      Modified generateProgram() to take a "lineNumber" arg and to add
      it to the CodeFragmentsInputBuffer.

      compiler/src/java/flex2/compiler/as3/BytecodeEmitter.java

      Modified DebugSlot() to no longer short circuit for a null
      InputBuffer and when the line number exceeds the InputBuffer
      length. This was a bogus short circuit, because it didn't take
      into consideration #includes. This fixes SDK-15527 in trunk.

      compiler/src/java/flex2/compiler/as3/binding/DataBindingExtension.java

      Updated generateConstructor() call to reflect new signature.

      compiler/src/java/flex2/compiler/as3/CodeFragmentsInputBuffer.java

      Modified "length" to start with 1 to work around ASC's default of
      setting positions to zero when synthetic.

      Modified getLnNum() to first check the positionToLineNumberMap
      before checking codeFragments List.

      Added addLineNumber().

      compiler/src/java/flex2/compiler/mxml/rep/init/EventInitializer.java

      Modified generateDefinitions() to set the position of the
      ReturnStatementNode, so fdb can know the extent of the event
      handler function.

      compiler/src/java/flex2/compiler/mxml/InterfaceGenerator.java

      Modified generateConstructor() to reflect new signature.

      compiler/src/java/flex2/compiler/mxml/ImplementationGenerator.java

      Modified constructor to pass the root's line number into
      generateProgram().

      Added generateConstructor() and modified generateClassDefinition()
      to use it.

      Ticket Links:
      ------------
      http://bugs.adobe.com/jira/browse/SDK-15781
      http://bugs.adobe.com/jira/browse/SDK-15527

      Modified Paths:
      --------------
      flex/sdk/trunk/modules/asc/src/java/macromedia/asc/embedding/avmplus/ActionBlockEmitter.j ava
      flex/sdk/trunk/modules/asc/src/java/macromedia/asc/parser/InputBuffer.java
      flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/AbstractSyntaxTreeUtil.java
      flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/BytecodeEmitter.java
      flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/CodeFragmentsInputBuffer.java
      flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/OffsetInputBuffer.java
      flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/binding/DataBindingExtension. java
      flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/ImplementationGenerator.java
      flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/InterfaceGenerator.java
      flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/init/EventInitializer.ja va