Closed Bug 1171168 Opened 10 years ago Closed 9 years ago

Ensure correct string coercion in AVM1 TextField text and htmlText setters

Categories

(Firefox Graveyard :: Shumway, defect)

defect
Not set
normal

Tracking

(firefox41 affected)

RESOLVED FIXED
Tracking Status
firefox41 --- affected

People

(Reporter: till, Assigned: till)

References

Details

AVM1's alCoerceString uses AVM2's axCoerceString for non-objects. That returns `null` for `null` and `undefined` instead of `"null"` and `"undefined"`, respectively. I'm not sure that's correct: it seems likely to be a quirk that only affects AVM2. Bug 1152155 has a SWF that's broken because of this: AVM1TextField#setText() coerces to string and assigns the result to the underlying AS3 TextField's text accessor. If AS code does something like `myTextField.text = undefined`, that causes an exception to be thrown because the value is converted to `null` instead of a string. In Flash, it causes the string "undefined" to be set. I tried fixing this in [1], but now XMLDocument doesn't properly work anymore: `new XMLDocument()` causes the initial firstChild to have a textValue of `"undefined"`. [1] https://github.com/tschneidereit/shumway/commit/6a382880154075f3abd3197a26f1ee9779d7fd42
After discussing this with Yury, I'm morphing this bug to be about just the coercion for the TextField text and htmlText setters.
Assignee: ydelendik → till
Status: NEW → ASSIGNED
Summary: Ensure correct string coercion in AVM1 → Ensure correct string coercion in AVM1 TextField text and htmlText setters
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.