ASC 2.0 Preview 2 Bug - Conditional Compilation around a constructor fails

Is this the right place to be reporting bugs?
Source class:
public class Something
CONFIG::debug
public function Something(id:uint)
CONFIG::release
public function Something()
In another class:
CONFIG::debug
var q:Something = new Something(10);
Compiling with Additional Compiler Arguments set to "-define+=CONFIG::debug,true -define+=CONFIG::release,false" results in the following warnings and errors:
    [mxmlc] Warning: return value for function 'Something' has no type declaration.
    [mxmlc]                               public function Something(id:uint)
    [mxmlc]                                               ^
    [mxmlc] Error: Incorrect number of arguments.  Expected no more than 0
    [mxmlc]                                         var q:Something = new Something(10);
    [mxmlc]                                                           ^

I could reproduce this issue with ASC 2. I've logged this as bug 3339009.
I'm guessing you have a more complex scenario in mind, but the workaround for this simple case might be to use default arguments to make the constructor parameter optional?
        public function Something(id:uint=0)
The bug does seem to impact constructors. Another workaround for now is to use a conditional factory pattern?
package
public class Something
    public function Something(id:uint=0)
        this.id = id;
      private var id:uint;
    CONFIG::debug {
        public static function createInstance(id:uint):Something
            return new Something(id);
   CONFIG::release {
        public static function createInstance():Something
            return new Something();

Similar Messages

  • [svn] 2716: SDK-15848 - Conditional compilation constants defined in flex-config. xml are never used if a single constant is specified on the command line

    Revision: 2716
    Author: [email protected]
    Date: 2008-08-04 01:18:12 -0700 (Mon, 04 Aug 2008)
    Log Message:
    SDK-15848 - Conditional compilation constants defined in flex-config.xml are never used if a single constant is specified on the command line
    * There's a possibility this will break a conditional complication test which disallows overwriting an existing definition -- I don't know if that will break the build, but the test should be removed either way.
    * Using append syntax ("-define+=" on the command line or ant tasks, or append="true" in flex-config) and redefining a value works now if you use an already-defined namespace and name.
    * So your flex-config may have -define=CONFIG::debug,false, and you may want -define+=CONFIG::debug,true from the commandline build, or FB build.
    * Made the ASC ConfigVar fields final as a sanity check since overwriting is now allowed. It would be harder to track changes and subtle bugs if they were mutable. This means that you must build a new ConfigVar object if you need to make changes.
    Bugs: SDK-15848
    QA: Yes. Please read the updated javadocs in CompilerConfiguration. Tests need to be added to validate that overwriting is allowed, and happens correctly in different situations: I believe the order should be that flex-config is overwritten by a custom config (can we have more than one user config? is the order deterministic? I forget...), is overwritten by commandline or OEM. Did I miss any? (I didn't write code which changes this, it works however the existing configuration system allows overwriting and appending; if we have tests for that, maybe we don't need them duplicated for this feature.)
    Doc: Yes. Please read the updated javadocs in CompilerConfiguration.
    Reviewer: Pete
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-15848
    http://bugs.adobe.com/jira/browse/SDK-15848
    Modified Paths:
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/embedding/ConfigVar.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/common/CompilerConfiguration.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/tools/oem/internal/OEMConfiguration.java

    Please note: I AM USING:
    JkOptions ForwardKeySize ForwardURICompat -ForwardDirectories
    And that's what's supposed to fix this problem in the first place, right??

  • [svn] 4836: Fix problems with asdoc comments and conditionally compiled definitions.

    Revision: 4836
    Author: [email protected]
    Date: 2009-02-04 11:07:52 -0800 (Wed, 04 Feb 2009)
    Log Message:
    Fix problems with asdoc comments and conditionally compiled definitions. Fixes bug http://bugs.adobe.com/jira/browse/ASC-3649
    Ticket Links:
    http://bugs.adobe.com/jira/browse/ASC-3649
    Modified Paths:
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/embedding/Compiler.java
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/semantics/ConfigurationEvaluator.java

    In the default php.ini is set open_basedir which limits work with php only to few directories (and directories bellow them). There is set /srv/http, /home,/tmp and /usr/share/pear by default.
    To allow your vhost you should add /data/www or set empty value.

  • Conditional Compilation (or something like this!)

    Hi all.
    In my application I would need to conditionally import a jar, depending on a configuration switch.
    I'm attaching here some sample code (written in "c++ conditional compilation mode") to explain better the situation:
    #ifdef (VERSION_5)
    path.to.mypackage.MyClass mc = new path.to.mypackage.MyClass();
    mc.doSomething();
    #endifWhat I need is not to be forced to include the package "path.to.mypackage" at compile-time if the version is not VERSION_5.
    Any help will be very appreciated!!

    I chose this way: provided that there's only one class in which I have to use the path.to.mypackageMyClass class, I load this class (runtime if conditioned) through reflection.
    So, the compiler doesn't require to see that package, that eventually gets loaded runtime.

  • Flash Builder 4.7 conditional compiling failed

    I installed Flash Builder 4.7 on my windows xp machine, and tried to migrate projects from FB 4.6. However in one of my projects I use conditional compiling, but I'm getting errors.For example in FB 4.6 I have this sample code:
    public class MyClass{
         CONFIG::DEBUGGING{
              import com.package.SomeClassOnlyForDebugging
         function someFunction():void{
              if (CONFIG::DEBUGGING){
                   SomeClassOnlyForDebugging.create();
    When I compiled it in FB 4.6 everything worked fine. However when I try to compile it in FB 4.7, then I get error on the conditional compiling only inside the function and not on the import statement. The only way I have found to overpass it is to go to Project>Properties>ActionScript Compiler and disable Enable strict type checking. But this is not a permanent solution.
    Am I doing something wrong, or is there some other way to do it?

    You should to do like that:
    function someFunction():void
    CONFIG::DEBUGGING {
         SomeClassOnlyForDebugging.create();
    without if.

  • Conditional compilation and import statements

    I have a web application written in Flex and I'm trying  to build an AIR application from the same code base using conditional  compilation.
    In the AIR application, I need to have import statements  such as the following:
    import flash.data.SQLConnection;
    import  flash.filesystem.File;
    but I cannot have these import statements in the web  application because they are AIR only classes.
    I thought I could use conditional compilation to  overcome this issue but then I read the following on page http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7abd.html:
    "You cannot use constant Boolean values to conditionalize metadata or import statements."
    If that's the case, how can I have common codebase for Flex based web as well as desktop applications? Has anyone solved this conundrum?
    Thanks,
    Dilip

    DilipShah, as far as I see the classes are still included if referenced by import.
    Example:
    I have this statement in my class A
    if(CONFIG::platform == "ios") {
                        import B;
    I can see in linkreport that class B is still included and is included because A is referencing it.
    Flex harUI, classes are included into final swf file if any other class is referencing it through import even though not using it. I've experimented with it quiet a bit.

  • Conditional compiling in abap

    Is it possible, to use "compiler directives" in ABAP (as known in other programming languages), especially "conditional compiling".
    I would like this technique, for a conditional compiling in following situation:
    DDIC-TABLE M_VMVD ist available up to R/3-Release 4.6C
    Since Release 4.70 this table is replaced by SHP_VIEW_EXVE.
    If possible, i want to write <u>one</u> coding for both releases.
    It is not sufficient to use a "normal" if - command, because syntax-check will detect an error (table xy is not known).
    Here a - fictional - example, what i think about:
    *# IF_COMPILER_RELEASE <  470.  (fictional Compiler-Directive)
    select single vbeln into my_vbeln from m_vmvmd where lifex = my_lifex.
    *# ELSE_COMPILER_DIRECTIVE (fictional)
    select single vbeln into my_vbeln from shp_view_exve where lifex = my_lifex.
    *# ENDIF_COMPILER_DIRECTIVE  (fictional)
    I know, that there was a conditional-compiling-technique for differing R/2 and R/3.
    It was something like that:
    *#R2    write: / 'Compiled with R/2'.
    *#R3   write: / 'Compiled with R/3'.
    Best Regards
    Juergen

    Hi jurgen,
    1. compiler directives are not supported in abap r/3,
      in the way, they are used in c and c++.
    2. However,
    3. For your requirement, we can use
        select with dynamic table name,
       and an if condition.
    4. To get a taste of it, just copy paste.
    5.
    REPORT abc.
    data : bukrs like t001-bukrs.
    data : tabname(30) type c.
    tabname = 'T001'.
    CONDITIONAL , NORMAL IF
    IF REL < 470.
    tabname = 'XYZT001'.
    ENDIF.
    select single bukrs
    from (tabname)
    into bukrs.
    WRITE :/ BUKRS.
    regards,
    amit m.

  • Background image in template viewable in preview but not in compiled output

    A co-worker, using RH8 on Windows XP is having a problem with a template that has a background .jpg image.  In RH8 the background image is viewable in the preview, but when she compiles the project the background is not there.  This image had been viewable in the compiled project when she was using RH7.
    I'm at a loss for what to suggest as I don't use backgrounds in my projects.
    Any info/suggestions would be greatly appreciated.
    Thanks,
    Joe

    Hi there
    The most obvious solution would be to try adding the image to Baggage Files. I'd try that first and see if it changes anything.
    With RoboHelp 8, you have an option of overriding the Style Sheet. So it's theoretically possible that what has been specified in the project is being undone by a subsequent choice.
    Try the Baggage option first.
    Cheers... Rick
    Begin learning RoboHelp HTML 7 within the day - $24.95!
    Click here for Adobe Certified Captivate and RoboHelp HTML Training
    Click here for the SorcerStone Blog
    Click here for RoboHelp and Captivate eBooks

  • Conditional compile code for debug v.s. release

    Hi,
    Is there a pre-defined symbol (e.g., DEBUG, DEBUG) for conditional compile section of code for debug v.s. release?
    Thanks for your reply in advance!

    Take a look at TargetConditionals.h, I use TARGETIPHONESIMULATOR a lot.

  • [svn] 3543: Asc front end performance improvements & bug fixes

    Revision: 3543
    Author: [email protected]
    Date: 2008-10-09 11:54:47 -0700 (Thu, 09 Oct 2008)
    Log Message:
    Asc front end performance improvements & bug fixes
    This set of Asc parser/scanner/inputbuffer updates contains changes that simplify the parser?\226?\128?\153s lookahead/match fsm.
    A method, ?\226?\128?\152shift()?\226?\128?\153 has been added that replaces match, when the token to be consumed is known.
    Also, a simplified version of lookahead has been added that returns the lookahead token, which allows use of switch code when the lookahead set is large.
    Simple inputbuffer changes (switching to a String, so that we can use substring instead of valueof) seem to result in about a 2% performance improvement.
    Fixes for:
    ASC-3519
    ASC-2292
    ASC-3545
    All being overlapping bugs related to regexp recognition in slightly differing contexts.
    QA: Yes
    Doc:
    Tests: checkintests, Performance tests, tamarin, asc-tests, mx-unit
    Ticket Links:
    http://bugs.adobe.com/jira/browse/ASC-3519
    http://bugs.adobe.com/jira/browse/ASC-2292
    http://bugs.adobe.com/jira/browse/ASC-3545
    Ticket Links:
    http://bugs.adobe.com/jira/browse/ASC-3519
    http://bugs.adobe.com/jira/browse/ASC-2292
    http://bugs.adobe.com/jira/browse/ASC-3545
    http://bugs.adobe.com/jira/browse/ASC-3519
    http://bugs.adobe.com/jira/browse/ASC-2292
    http://bugs.adobe.com/jira/browse/ASC-3545
    Modified Paths:
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/parser/InputBuffer.java
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/parser/Parser.java
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/parser/Scanner.java
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/parser/States.java

    In reference to this change in the Custom Reports... Better experience when exporting data - to prevent customer confusion when exporting data from Mac computers, we have removed the export to excel option and exporting in CSV format by default.
    What is the customer confusion we are trying to stop here? I've got even more confused customers at the moment because all of a sudden they can't find the export to excel option but know it exists if they log in on a PC?
    Mark

  • [svn:fx-trunk] 12343: ASC add check in ReferenceValue. getSlot to work around inconsistency

    Revision: 12343
    Revision: 12343
    Author:   [email protected]
    Date:     2009-12-01 15:37:04 -0800 (Tue, 01 Dec 2009)
    Log Message:
    ASC add check in ReferenceValue.getSlot to work around inconsistency
    in the way FunctionCommonNode for nested functions are getting analyzed
    (fixes ASC-3734; r=tharwood)
    Ticket Links:
        http://bugs.adobe.com/jira/browse/ASC-3734
    Modified Paths:
        flex/sdk/trunk/modules/asc/src/java/macromedia/asc/semantics/ReferenceValue.java

    This is a duplicate post.  This should be locked to avoid further confusion.
    My CSS wont change
    Nancy O.

  • [svn:bz-trunk] 13685: Bug: Some checkintests on Mac are failing.

    Revision: 13685
    Revision: 13685
    Author:   [email protected]
    Date:     2010-01-21 05:19:59 -0800 (Thu, 21 Jan 2010)
    Log Message:
    Bug: Some checkintests on Mac are failing.
    QA: Yes
    Doc: No
    Details: Changed the port of bad-http channel in ConfigurationBasedTestCase, so checkintests work more consistently on Mac, on Mac port 88 is used by some process, thanks to John for figuring this out. With this change, checkintests on Mac are more consistent but there are 2 tests that are still intermittently failing.
    Modified Paths:
        blazeds/trunk/qa/apps/qa-regress/testsuites/flexunit/src/mx/messaging/tests/ChannelSetTes t.as
        blazeds/trunk/qa/apps/qa-regress/testsuites/flexunit/src/mx/messaging/tests/Configuration BasedTestCase.as
        blazeds/trunk/qa/apps/qa-regress/testsuites/flexunit/src/mx/messaging/tests/ConsumerWithS erverTest.as

    I removed the src/ directory and ran makepkg and it succeeded. Pacman -U kernel.pkg.tar.gz also worked. Now all that's left is rebooting and trying.
    Thanks everyone.
    OK, I guess it's not over yet. I rebooted in the new kernel, but it says it can't find /dev/sda3 (which is my / partition).
    This is my grub entry:
    title Arch Linux Gigamo
    root (hd0,2)
    kernel /boot/vmlinuz26 root=/dev/sda3 ro
    initrd /boot/kernel26-gigamo.img
    Okay well, I didnt realise there was a vmlinux26-gigamo as well. Will see if that fixes it.
    Last edited by Gigamo (2008-03-12 16:53:22)

  • [svn:fx-trunk] 5812: Fixed a bug where direct use of Animation failed because AnimationProperty was not setting up its internal keyframes with correct duration information , so the animation would skip immediately to the end.

    Revision: 5812
    Author: [email protected]
    Date: 2009-03-31 11:34:56 -0700 (Tue, 31 Mar 2009)
    Log Message:
    Fixed a bug where direct use of Animation failed because AnimationProperty was not setting up its internal keyframes with correct duration information, so the animation would skip immediately to the end.
    Bugs: SDK-20356
    QE Notes: spark/effects Mustella tests currently hosed, couldn't run test suite
    Doc Notes: None
    Reviewer: Jason
    Testing: checkintests, Mustella effects tests could not be run (post-rename issues)
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-20356
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimationProperty.as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/Animation.as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateColorIns tance.as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateShaderTr ansitionInstance.as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/FadeInstance.as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/MoveInstance.as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/ResizeInstance. as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/Rotate3DInstanc e.as
    flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/RotateInstance. as

    Hi
    Can you please try setting up full persmission in the security properties for everyone on the wsconfig folder C:\ColdFusion10\config\wsconfig  and restart ColdFusion Server.
    Swaraj

  • Error compiling for IOS "map failed"

    Since i have installed Flash Builder 4.6 I allways get an error when I compile for Device "Map Failed".
    Compiling for Desktop works fine. When I used Flash Builder 4.5.1 I had sometimes the same problem,
    but sometimes compiling worked.
    here is the logfile:
    !ENTRY com.adobe.flexbuilder.project 4 43 2011-12-07 12:16:06.832
    !MESSAGE Map failed
    !STACK 0
    java.lang.Exception
        at com.adobe.flexbuilder.project.internal.FlexProjectCore.createErrorStatus(FlexProjectCore. java:1019)
        at com.adobe.flexbuilder.util.logging.GlobalLogImpl.log(GlobalLogImpl.java:66)
        at com.adobe.flexbuilder.util.logging.GlobalLog.log(GlobalLog.java:52)
        at com.adobe.flexide.multiplatform.ios.packaging.IPAPackager.create(IPAPackager.java:276)
        at com.adobe.flexide.multiplatform.ios.launching.IOSOnDeviceLaunchHandler.doPackage(IOSOnDev iceLaunchHandler.java:314)
        at com.adobe.flexide.multiplatform.ios.launching.IOSOnDeviceLaunchHandler.launch(IOSOnDevice LaunchHandler.java:185)
        at com.adobe.flexide.launching.multiplatform.MultiPlatformLaunchDelegate.launch(MultiPlatfor mLaunchDelegate.java:191)
        at com.adobe.flexide.launching.AbstractFlexLaunchDelegate.launch(AbstractFlexLaunchDelegate. java:244)
        at com.adobe.flexide.launching.AbstractFlexLaunchDelegate.launch(AbstractFlexLaunchDelegate. java:134)
        at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:854)
        at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
        at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:928)
        at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1132)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
    !ENTRY com.adobe.flexbuilder.project 4 43 2011-12-07 12:16:07.520
    !MESSAGE Fehler beim Verpacken der Anwendung:
    Map failed
    What can I do ?

    I am getting a similar error when exporting a release build for ios.
    It seems to be caused by the number of assets I include in the project. If I remove all of the video assets from the package it builds a working release. When the video assets are included, it fails to export the release build with the error "map failed".
    So it seems to be the number of assets included or the total size of the included assets that causes the error for me. But I can't find a way around it so can't currently export a release build with all the required assets.
    I'm starting to wonder wether I'm going to have to write some kind of "updater" to download all the required assts to the iOS device when the app is first run, which isn't ideal.

  • This bug has been around for over a year: SecurityError: Error #2123: Security sandbox violation

    Hi,
    The bug of 'SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: file:///xxx/xxx.swf cannot access rtmfp://fms4.acrobat.com/cocomo/na2-sdk-xxx/xxx. No policy files granted access.' was first reported in lccs forum over a year ago:
    http://forums.adobe.com/message/2803074
    But the bug is still around. The bug can be generated by calling BitmapData.draw() on a flash.media.Video object which is attached to a p2p stream. It looks like the solution is to have the publisher to call:
    send("|RtmpSampleAccess", true, true)
    on the NetStream object _before_ the subscriber calls NetStream.play(), in order to give the permission to subscribers for audio and video streams.
    In lccs library, the above permission authorisation happens in WebcamPublisher:
    protected function onNetStatus(p_evt:NetStatusEvent):void
    if (p_evt.info.code=="NetStream.Connect.Success") {
    setTimeout(sendSnapShotPermission, 500);
    _stream.send("|RtmpSampleAccess", true, true);
    protected function sendSnapShotPermission():void
    _stream.send("|RtmpSampleAccess", true, true);
    but it doesn't help the problem. In fact, it is not clear to me when this 'snap shot permission' is sent to the subscriber.
    One more note: This is not a critisism for the lccs development quality, but rather a question on how ready lccs is for production use. After encountering this bug, I had to go through the lccs code (the open source parts), and found out that the library is not really written, well, carefully, and it is full of temporary quick-n-dirty fixes.
    For instance in the above example, sendSnapShotPermission() is called after 500 milliseconds, probably to allow something to happen before calling the method, but how can you be sure that it will happen in 500 milliseconds? Probably,an event listener should have been used. Immediately in the next line, we see:
    _stream.send("|RtmpSampleAccess", true, true);
    which is a duplicate of sendSnapShotPermission(). many examples like this can be found throughout the library.
    Aureliano

    Hi Nigel,
    Two questions:
    1. When the publisher sends the access permission to the subcriber by:
    netStream.send("|RtmpSampleAccess", true, true)
    , on the subscriber side, what event or function can handle the guaranteed receipt of the access permission? Currently it is possible to draw the incoming stream video upon receiving NetStream.Play.Star and waiting for 5 seconds or so:
    public class MyWebcamSubscriber extends WebcamSubscriber {
    override protected function layoutCameraStreams():void
    // trying the event listener seems to work here.
    _streamManager.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
    override protected function onNetStatus(e:NetStatusEvent):void
    super.onNetStatus(e);
    case "NetStream.Play.Start":
    setTimeout(function():void {
    // draw the video from the incoming stream here.
    }, 5000);
    The questions is, which event can let the subscriber know that it has the access permission to the video stream?
    2. In WebcamPublisher, why is that the access permission is sent 3 times?
    a. Once on receiving NetStream.Connect.Success with 0.5 second delay, as in below.
    b. Once immediately upon receiving NetStream.Connect.Success, as in below.
    protected function onNetStatus(p_evt:NetStatusEvent):void
    if (p_evt.info.code=="NetStream.Connect.Success") {
    setTimeout(sendSnapShotPermission, 500);
    _stream.send("|RtmpSampleAccess", true, true);
    protected function sendSnapShotPermission():void
    _stream.send("|RtmpSampleAccess", true, true);
    c. Once in onConnectionTypeChange() with 2 seconds delay:
    protected function onConnectionTypeChange(p_evt:StreamEvent):void
    if ( _streamManager.isP2P) {
    _stream= new NetStream(_connectSession.sessionInternals.session_internal::connection as NetConnection,NetStream.DIRECT_CONNECTIONS);
    setTimeout(sendSnapShotPermission, 2000);

Maybe you are looking for