Closed Bug 949059 Opened 10 years ago Closed 10 years ago

"Return value is not an object." thrown when changing input in Contacts

Categories

(Core :: DOM: Core & HTML, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: julienw, Assigned: xyuan)

References

Details

Attachments

(1 file, 1 obsolete file)

STR:
* launch the contacts app
* press "+" to add an ew contact
* type something in "name"
* tap the "Last name" entry
* have a look to the logcat

=> [JavaScript Error: "Return value is not an object."]

I debugged this with gdb with :bz and :padenot, and this traces to the "mgmt" property of MozInputMethod. See [1] for the full stack trace.

:bz thinks it could be related to the commit [2] (Bug 905573) because the implementation can return "null" in some situations ([3]) whereas the IDL wants an object.

I honestly don't know if there is a practical implication. The main issue is that it adds lines to the log, and since there is another issue (to be filed by :bz) we don't see the originating file, and this makes other bugs more difficult to debug.

[1] http://pastie.org/8545283
[2] http://hg.mozilla.org/mozilla-central/rev/20b30db87bf4
[3] http://hg.mozilla.org/mozilla-central/rev/20b30db87bf4#l2.206
Component: Gaia::Keyboard → DOM
Flags: needinfo?(fabrice)
Product: Firefox OS → Core
The practical issue is that doing .mgmt will throw in the situations in which the getter returns null.

If that's the desired behavior, the getter should instead be throwing, with a more informative error message than just "hey, you promised this wouldn't be null but returned null!".  But I expect it's not the desired behavior.
Attached patch patch v1 (obsolete) — Splinter Review
It's an implementation bug. The "mgmt" property of MozInputMethod should never be null.
Attachment #8346061 - Flags: review?(fabrice)
Comment on attachment 8346061 [details] [diff] [review]
patch v1

Test, please!  ;)
Comment on attachment 8346061 [details] [diff] [review]
patch v1

Review of attachment 8346061 [details] [diff] [review]:
-----------------------------------------------------------------

r=me but as bz said, we need tests to land that.
Attachment #8346061 - Flags: review?(fabrice) → review+
Flags: needinfo?(fabrice)
@Fabrice, could you help me to land bug 932145?  So that I can write a test based on that bug.
Status: NEW → ASSIGNED
Depends on: 932145
Flags: needinfo?(fabrice)
Yep, I just reviewed it!
Flags: needinfo?(fabrice)
Assignee: nobody → xyuan
Add mochitest.
https://tbpl.mozilla.org/?tree=Try&rev=10ce31c5418a
Attachment #8346061 - Attachment is obsolete: true
Attachment #8350869 - Flags: review?(fabrice)
Attachment #8350869 - Attachment is patch: true
Attachment #8350869 - Flags: review?(fabrice) → review+
https://hg.mozilla.org/mozilla-central/rev/ab453d9db208
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: