Crash of an invalid snippet

Issue #161 resolved
Christian-W. Budde created an issue

Again, I have found an intermediate state that results in a crash (access to a null pointer). I haven’t researched it further so far:

unit FooBar

interface

type 
  TFoo = class

  TBar = class
  protected
    class var FooBar: String;
  end;

implementation

end. 

Comments (3)

  1. Christian-W. Budde reporter

    Sorry for the late reply, but I have been in the summer vacations.

    I think that the current fix is too limiting. If one wants to nest an anonymous class within an anonymous class it should be allowed, especially in combination with the JSCodeGen.

    Otherwise it’s not possible to pass non typed complex parameters to external functions. For examples sometims the options that need to be passed are quite complex.

    In my code I have something like:

    pushNotification.init(JInitOptions(
      class
        android = class
          senderID = '644366289459';
        end;
        ios = class
          alert = 'true';
        end;
      end));
    

    which worked out pretty well in the past.

    After compilation the code looks like:

    pushNotification.init({
      android: {senderID = '644366289459'}; 
      ios: {alert: "true"}
    }
    

    With the patch, the above code doesn’t work anymore. Maybe there are other ways to solve this, but the above code should also work.

  2. Log in to comment