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

Regression: methods passed through contexts not returning values

    Details

      Description

      {html}<div><p>Variable/method passing through contexts was completely broken
      in 1.4.1.1 on Android, but in 1.4.2 (a build from 10/7) it was
      fixed and working beautifully. However, now in 1.5.0 it's broken
      again (though not quite as broken as before).</p>
      <p>Here's what the log shows in 1.4.2 when I run the attached
      testcase:</p>
      <pre>
      <code>[INFO] Titanium SDK version: 1.4.2 (10/07/10 15:15 2373d78)
      [INFO] Deployed Sandbox ... Application should be running.
      [INFO] [194,2438] 1.0
      [INFO] [14,2452] win.b() = hello
      [INFO] [11,2463] {"instanceVar":123,"method":"org.appcelerator.titanium.kroll.KrollCallback@43eb9160"}
      [INFO] [7,2470] 123.0
      [INFO] [17,2487] function method called
      [INFO] [10,2497] function getProps called
      [INFO] [6,2503] win.glob.getProps(): [object Object]
      [INFO] [8,2511] win.glob.getProps().propOne: property 1
      [INFO] [4,2515] function getClass called
      [INFO] [12,2527] win.glob.getClass(): [object Object]
      [INFO] [11,2538] win.glob.getClass().instanceVar: 123</code>
      </pre>
      <p>And here's what it shows in 1.5.0:<br></p>
      <pre>
      <code>[INFO] Titanium SDK version: 1.5.0 (10/26/10 19:22 6add5e1)
      [INFO] Deployed Sandbox ... Application should be running.
      [INFO] [95,3090] 1.0
      [INFO] [62,3152] win.b() = undefined
      [INFO] [68,3220] {"instanceVar":123,"method":"org.appcelerator.titanium.kroll.KrollCallback@43ecd520"}
      [INFO] [3,3223] 123.0
      [INFO] [183,3406] win.glob.getProps(): undefined
      [INFO] [30,3436] win.glob.getProps().propOne: undefined
      [INFO] [3,3439] win.glob.getClass(): undefined
      [INFO] [3,3442] win.glob.getClass().instanceVar: undefined
      [INFO] [9,3451] function method called
      [INFO] [2,3453] function getProps called
      [INFO] [4,3457] function getClass called</code>
      </pre>
      <p>Here's an abridged example from the test case:<br></p>
      <pre>
      <code class="javascript">// parent context (app.js)
      var glob = {};
      glob.getProps = function() {<br>
      <br>


      </code>
      </pre>
      <pre>
      <code class=
      "javascript"><code>Ti.API.info('function getProps called');

      return {propOne: 'property 1', propTwo: 'property 2'};</code></code>
      </pre>
      <pre>


      <br>
      };
      win.glob = glob;

      <br>
      // child context (test.js)
      var obj = win.glob.getProps(); // runs code in method but returns undefined
      </pre></div>{html}

        Attachments

          Activity

            People

            • Assignee:
              mculpepper Marshall Culpepper
              Reporter:
              matthewlieder Matthew Lieder
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration