Details

    • Type: Bug
    • Status: Reopened
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: Release 2.1.2, Release 3.1.0
    • Fix Version/s: None
    • Component/s: Android
    • Labels:
    • Environment:
      • Titanium SDK 2.2.0.v20120823190912
      • Android 4.0.3
      • v8
      • Thinkpad Tablet
      • OSX Mountain Lion

      Description

      The problem

      Well, I don't know how to explain the problem, or what precisely is causing it ... so it's the best if I just jump to example.

      Test case

      var i = 0;
       
      var win = {
          backgroundColor: '#000',
          __TiElement: null,
          __getTiElement: function() {
              if (!this.__TiElement) {
                  this.__TiElement = Ti.UI.createWindow(this);
              }
              return this.__TiElement;
          },
          open: function() {
              Ti.API.info(i++);
              this.__getTiElement().open();
          }
      };
       
      win.open();
      

      Run this example, and you should get infinite loop (see in DDMS, i goes from 0 to infinity).

      As I said, I'm not sure what's causing the problem, but it seems that "this" value is somehow set to wrong value (TiUIWindow because "win" and that causes infinite loop).

      The problem can be solved if non-enumerable properties are used (by using "Object.defineProperty").

      The issue does not exist on iOS.

        Attachments

          Activity

            People

            • Assignee:
              emerriman Eric Merriman
              Reporter:
              ivan.skugor Ivan Skugor
            • Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:

                Git Source Code