tracker issue : CF-4201781

select a category, or use search below
(searches all categories and all time range)
Title:

The parser will throw exception if closure used with arguments in a new object creation syntax

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/CannotReproduce

Reporter/Name(from Bugbase): Luis Majano / ()

Created: 03/29/2018

Components: Language, Functions

Versions: 2016

Failure Type: Others

Found In Build/Fixed In Build: latest /

Priority/Frequency: Normal /

Locale/System: / Linux All

Vote Count: 0

Problem Description:

if you have the following code:

var consumerValue = "";

                new cbstreams.Optional()
                    .of( "luis" )
                    .ifPresent( function( e ){
                        consumerValue = e;
                    } );

                expect( consumerValue ).toBe( "luis" );

The parser will explode in the closure of the ifPresent() function because it has incoming arguments.

If you remove the e argument, it compiles. if you do an assignment it compiles.  But inline it blows up.

var consumerValue = "";

                var optional = new cbstreams.Optional().of( "luis" );
                    optional
                    .ifPresent( function( e ){
                        consumerValue = e;
                    } );

                expect( consumerValue ).toBe( "luis" );

Attachments:

Comments:

Hi Louis, I tried reproducing your code but could not . I will attach the piece of testcode I am using . Please send us your code . You can either email it to me at suchsing@adobe.com or attach in the bug . Thanks, Suchika
Comment by Suchika S.
27517 | April 12, 2018 03:24:02 PM GMT
I can't extract your rar archive, it says it can't. I am on a mac. Can you do zip?
Comment by Luis M.
29533 | August 17, 2018 04:04:30 PM GMT
Hi Louis, I have attached the code as zip . Please check. Thanks, Suchika.
Comment by Suchika S.
29575 | August 21, 2018 09:35:16 AM GMT
Hi Louis , Did you get a chance to look at the code that I have attached? Please send us a repro code if you have one. Thanks, Suchika
Comment by Suchika S.
29626 | August 28, 2018 11:22:21 AM GMT
Hi Louis, I am presuming that its not a bug anymore and hence closing it . Please let us know if you are still facing the issue , we would re-open the bug.   Thanks, Suchika
Comment by Suchika S.
29666 | September 05, 2018 06:43:15 AM GMT