| Summary: | Not all 'this' references are marked in an object | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Michael Rennie <Michael_Rennie> | ||||
| Component: | JS Tools | Assignee: | Michael Rennie <Michael_Rennie> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | curtis.windatt.public | ||||
| Version: | 5.0 | Flags: | curtis.windatt.public:
review+
|
||||
| Target Milestone: | 5.0 RC1 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Michael Rennie
Looks like this could just be a scoping problem.
The following snippet marks all the 'this' values fine:
var foo = {
bool: true,
f1: function() {
this.bool;
},
f2: function() {
this.bool;
},
f3: function() {
this.bool;
}
};
While this one does not:
function call(arg) {}
call({
bool: true,
f1: function() {
this.bool;
},
f2: function() {
this.bool;
},
f3: function() {
this.bool;
}
});
looks like we are short-circuiting all the fun scope work in 'enterThis' when we encounter a call expression.
Created attachment 239581 [details]
fix
Fixes the marking across object / call expression boundaries + adds a pile more tests
+1, tests cover substantially more cases and all pass. Tested a number of cases in editorCommands where we switch between 'this' and 'self', everything looks accurate. |