[TIMOB-9636] iOS: "this" variable does not occur in variables view in the Studio debugger
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-09-13T04:43:11.000+0000 |
Affected Version/s | Release 2.0.1 |
Fix Version/s | Sprint 2012-15 Core, Release 2.1.2, Release 3.0.0 |
Components | iOS |
Labels | SupportTeam, core, module_views, qe-review, qe-testadded |
Reporter | Varun Joshi |
Assignee | Neeraj Gupta |
Created | 2012-05-17T12:13:18.000+0000 |
Updated | 2012-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 screenshotsAttachments
File | Date | Size |
---|---|---|
Screenshot-Android.png | 2012-05-17T12:13:18.000+0000 | 211925 |
Screenshot-Android(2).png | 2012-06-01T01:21:33.000+0000 | 223299 |
Screenshot-ios.png | 2012-05-17T12:13:18.000+0000 | 166451 |
Screenshot-iOS(2).png | 2012-06-01T01:21:33.000+0000 | 178892 |
Sounds like this is an intrinsic platform difference (and out of Studio's control). If the different behavior is desired, please reopen against TIMOB.
"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.
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.
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.
Hi, I have attached two more screenshots showing the breakpoint inside the function and "this" being shown on Android but not on iOS.
Please review the above comment and confirm if this ticket can be reopened. Thanks, Varun
Hi Varun...It sounds like this should be moved to TIMOB...Studio doesn't control the appearance (or not) of "this".
TESTING
---- Create a project with the following:app.js
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 valuesPR merged https://github.com/appcelerator/titanium_mobile/pull/2592
Backport PR https://github.com/appcelerator/titanium_mobile/pull/2737
Fixed on 2_1_X by https://github.com/appcelerator/titanium_mobile/pull/2737
Verified fix with: Titanium Studio, build: 2.1.1.201207271312 Titanium SDK: 2.1.2.v20120815081613 Devices: Simulator 5.1
Reopening to update labels