Closed
Bug 706795
Opened 13 years ago
Closed 13 years ago
TI: Setter on Object.prototype is not called
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 706808
People
(Reporter: decoder, Assigned: bhackett1024)
References
Details
(Keywords: testcase, Whiteboard: js-triage-needed)
Attachments
(1 file)
4.20 KB,
patch
|
Details | Diff | Splinter Review |
The following test produces different output with options "-m -a" vs. "-m -a -n" on mozilla-central revision ca140190529a: var gTestcases = new Array(); function TestCase() { this.name = "foo"; gTestcases[0] = this; } var cnName = 'name'; var cnNameSetter = function(newValue) {}; Object.prototype.__defineSetter__(cnName, cnNameSetter); new TestCase(); print(uneval(gTestcases)); Output: $ $JS -m -a min.js [{}] $JS -m -a -n min.js [{name:"foo"}]
Reporter | ||
Comment 1•13 years ago
|
||
Smaller testcase with standard ES5: Object.defineProperty(Object.prototype, 'x', { set: function() { print("Hello world"); } }); function A() { this.x = 12; } new A(); With TI, the setter defined here is never called, without TI it is. Bug 706808 could be the same issue as it's also using defineProperty on Object.prototype.
See Also: → 706808
Updated•13 years ago
|
Assignee | ||
Comment 3•13 years ago
|
||
Two related problems when generating constraints to make sure these prototype setters actually get called. - Types for the prototype's property were not necessarily being propagated from the prototype's own prototype, so if the setter was not on the direct prototype then it may not have been noticed while analyzing the 'new' properties of the script. - Things were being done in the wrong order, so that even if the prototype setter was detected the property would still be marked as definitely held by the 'new' script objects (though further analysis would then stop).
Assignee: general → bhackett1024
Attachment #579118 -
Flags: review?(luke)
Assignee | ||
Comment 4•13 years ago
|
||
Comment on attachment 579118 [details] [diff] [review] patch Cancelling, bug 706808 exposed more semantic problems with this code so going to put a rolled up patch there.
Attachment #579118 -
Flags: review?(luke)
Assignee | ||
Updated•13 years ago
|
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•