Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9636] iOS: "this" variable does not occur in variables view in the Studio debugger

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-09-13T04:43:11.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sSprint 2012-15 Core, Release 2.1.2, Release 3.0.0
ComponentsiOS
LabelsSupportTeam, core, module_views, qe-review, qe-testadded
ReporterVarun Joshi
AssigneeNeeraj Gupta
Created2012-05-17T12:13:18.000+0000
Updated2012-09-13T04:43:11.000+0000

Description

Problem

Titanium Studio's debugger in iOS does not show the "this" variable in the Variables view automatically. For Android, it works fine. Please see the attached screenshots

Attachments

FileDateSize
Screenshot-Android.png2012-05-17T12:13:18.000+0000211925
Screenshot-Android(2).png2012-06-01T01:21:33.000+0000223299
Screenshot-ios.png2012-05-17T12:13:18.000+0000166451
Screenshot-iOS(2).png2012-06-01T01:21:33.000+0000178892

Comments

  1. Ingo Muschenetz 2012-05-21

    Sounds like this is an intrinsic platform difference (and out of Studio's control). If the different behavior is desired, please reopen against TIMOB.
  2. Josh Roesslein 2012-05-21

    "this" shouldn't really be shown in this case, but happens on Android/V8 due to how we internally wrap the module's source into a function. This isn't something we will implement in iOS since it isn't intended behavior.
  3. Alan Leard 2012-05-24

    Josh, Can we get clarification on why this isn't intended behavior. We have customers that would like to be able to see properties attached to 'this' in the debugger.
  4. Josh Roesslein 2012-05-31

    Alan, The only time we should really show "this" is when we are inside a function. In the screenshot they have "break" in the top level scope in app.js. All the globals are already listed in the variables view. Is there any variables in particular that are missing that can be seen when expanding "this"? If so that is a bug and they should be listed in the variables view.
  5. Varun Joshi 2012-06-01

    Hi, I have attached two more screenshots showing the breakpoint inside the function and "this" being shown on Android but not on iOS.
  6. Varun Joshi 2012-06-15

    Please review the above comment and confirm if this ticket can be reopened. Thanks, Varun
  7. Ingo Muschenetz 2012-06-15

    Hi Varun...It sounds like this should be moved to TIMOB...Studio doesn't control the appearance (or not) of "this".
  8. Stephen Tramer 2012-07-17

    TESTING

    ---- Create a project with the following: app.js
       var win = Ti.UI.createWindow({
           backgroundColor: '#000',
           navBarHidden: true
       });
         
       var view = Ti.UI.createView({ width: '100%', height: '100%', backgroundColor: '#f00' });
         
       view.addEventListener('click', function(e){
           Ti.API.info('View click');
           Ti.API.info(this);
       });
       var button = Ti.UI.createButton({width:150, height:150, title: 'Click me!' });
        
       view.add(button);
       win.add(view);
        
       win.open();
       
    Set breakpoints at: * Line 10 (Ti.API.info(this)) * Line 14 (view.add(button)) In the "debug" view, add the following to the "Expressions" pane: * this * this.width Debug the app in iPhone simulator:

    Breakpoint at line 14 should be hit.

    #* Should NOT contain "this" in variables list

    *Hit CONTINUE*

    Click an element in app (view, button, whatever)

    Breakpoint at line 10 should be hit.

    #* Should contain "this" in variables list #* "this" should be identical to the source of the event, "e > source" (*NOTE*: This will change when TIMOB-9085 is resolved) #* The "Expressions" pane should properly evaluate both "this" and "this.width" to the correct values
  9. Max Stepanov 2012-07-19

    PR merged https://github.com/appcelerator/titanium_mobile/pull/2592
  10. Max Stepanov 2012-08-13

    Backport PR https://github.com/appcelerator/titanium_mobile/pull/2737
  11. Vishal Duggal 2012-08-14

    Fixed on 2_1_X by https://github.com/appcelerator/titanium_mobile/pull/2737
  12. Olga Romero 2012-08-15

    Verified fix with: Titanium Studio, build: 2.1.1.201207271312 Titanium SDK: 2.1.2.v20120815081613 Devices: Simulator 5.1
  13. Anshu Mittal 2012-09-13

    Reopening to update labels

JSON Source