Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-26553

Android: Java code has no means of distinguishing between undefined and null coming from JavaScript


    • Type: Bug
    • Status: Open
    • Priority: High
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Android
    • Labels:


      Our Android runtime has no means of passing along the difference between null and undefined when passing arguments to Java. We do have a KrollRuntime.UNDEFINED object that was intended to be used as the placeholder for undefined in Java, but it's only really used on the C++ side to wipe out some properties for the APIModule.

      Specifically, we do have code for translating that object into undefined when converting from Java to JS, but when we receive null or undefined and try to convert to a Java Object in TypeConverter.cpp we translate that into a C++ NULL, which then becomes a Java null.

      Typically this hasn't mattered that much, but the distinction can be useful for determining if a method's optional arguments were explicitly passed a null versus not being specified at all (or explicitly passed undefined).


          Issue Links



              • Assignee:
                jquick Joshua Quick
                cwilliams Christopher Williams
              • Watchers:
                3 Start watching this issue


                • Created:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    Sync status:
                    Last received:
                    Last sent:

                    Git Integration