Closed Bug 517229 Opened 16 years ago Closed 16 years ago

SecureMembrane.BaseWrapper.iteratorObject is broken

Categories

(Mozilla Labs :: Jetpack Prototype, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: adw, Assigned: adw)

Details

Attachments

(1 file)

None of the Twitter lib functions work in the 0.5 release and current trunk. Here's the error and stack (from code in the Bespin panel) they all produce: TypeError: this.safeGetProperty is not a function keyValueIterator()@chrome://jetpack/content/js/secure-membrane.js:144 userOptsToAjaxOpts([object FlexibleWrapper])@chrome://jetpack/content/js/twitter.js:343 ([object FlexibleWrapper])@chrome://jetpack/content/js/twitter.js:313 call((function (opts) {try {var ajaxOpts = userOptsToAjaxOpts(opts);var url = [aSchemeAndHost].concat(urlFrags).concat(interpParam ? ajaxOpts.data[interpParam] : []).join("/") + ".json";ajax(url, aHttpMethod, ajaxOpts);} catch (err) {dump("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" + err + "\n" + err.stack + "\n");}}),[object FlexibleWrapper],[object FlexibleWrapper],[object Array])@chrome://jetpack/content/js/secure-membrane.js:285 @:0 @file:///Users/adw/Library/Application%20Support/Firefox/Profiles/beb1kaoj.jetpack2/jetpack-editor-code.txt:3 All Twitter lib functions go through userOptsToAjaxOpts(), which takes an object passed in by the feature, aUserOpts, and iterates over its keys and values: for (let [prop, val] in Iterator(aUserOpts)) dupe[prop] = val; Line 343 as indicated by the stack is the second line above. dupe is an object local to userOptsToAjaxOpts(). Atul, what exactly is the problem here? Is line 343 erroneous? Is it actually Iterator(aUserOpts) that's causing the error in keyValueIterator()?
SecureMembrane.BaseWrapper.iteratorObject is broken due to a typo, |this| -> |self| in the inner keyValueIterator function. |this| evaluates to the global object, not the object being iterated over. |self| is defined but never used.
Summary: Twitter library is broken → SecureMembrane.BaseWrapper.iteratorObject is broken
Attached patch patch + testSplinter Review
Atul, can you review this so we can land it ASAP? This bug breaks Twitter and my menu code. Really annoying.
Attachment #401688 - Flags: review?(avarma)
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Attachment #401688 - Flags: review?(avarma)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: