Closed
Bug 618101
Opened 14 years ago
Closed 14 years ago
SyntaxError ("let" doesn't work) when loading bootstrap.js to call uninstall() from a disabled add-on
Categories
(Toolkit :: Add-ons Manager, defect)
Toolkit
Add-ons Manager
Tracking
()
VERIFIED
FIXED
mozilla2.0b10
Tracking | Status | |
---|---|---|
blocking2.0 | --- | betaN+ |
People
(Reporter: Mardak, Assigned: asaf)
Details
(Whiteboard: [hardblocker])
Attachments
(2 files, 3 obsolete files)
708 bytes,
application/x-xpinstall
|
Details | |
1.03 KB,
patch
|
Details | Diff | Splinter Review |
If you install the attached add-on then disable it then install it again, you'll get the following warning and uninstall() doesn't run.
Warning: WARN addons.xpi: Error loading bootstrap.js for restartless@agadak.net: SyntaxError: missing ; before statement
Source File: resource://gre/modules/XPIProvider.jsm -> jar:file://../extensions/restartless@agadak.net.xpi!/bootstrap.js
Line: 1
bootstrap.js:
let x = 0;
function startup() {}
function shutdown() {}
function install() {}
function uninstall() {}
It seems like whatever is creating the sandbox happens to be using an older version of js somehow.
Reporter | ||
Comment 1•14 years ago
|
||
This only happens if the add-on is disabled when installing it again.
If I disable, uninstall (+ reload about:addons), the bootstrap.js loads fine and calls uninstall().
So it seems like there's only a problem when bootstrap.js needs to be loaded for a disabled add-on to call uninstall.
Comment 2•14 years ago
|
||
Edward, please always post the build id you are using. That gives us really helpful information. So let me ask it from you. If you don't use one of the latest minefield builds, please update. Bug 596580 got fixed lately, which could be a symptom. If not, which JS version are we using for bootstrapped add-ons?
Reporter | ||
Comment 3•14 years ago
|
||
Build identifier: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b8pre) Gecko/20101209 Firefox/4.0b8pre
Updated•14 years ago
|
blocking2.0: --- → betaN+
Comment 4•14 years ago
|
||
This is probably to do with the creation of the sandbox happening either from an XPCOM component's context (for the normal startup case) or the window context (for the uninstall while disabled case).
Comment 5•14 years ago
|
||
Wait no that is not it at all. This is a confusing one.
Comment 6•14 years ago
|
||
There is still the open bug 613383. Not sure if it could matter for this issue.
Updated•14 years ago
|
Assignee: nobody → dtownsend
Comment 7•14 years ago
|
||
Bug 595691 could certainly be related, though it's not clear why we'd ever _downgrade_ the version...
Reporter | ||
Comment 9•14 years ago
|
||
Bug 604301 might also be related?
Assignee | ||
Comment 10•14 years ago
|
||
We don't run the code through eval or evalInSandbox.
Updated•14 years ago
|
Whiteboard: [hard blocker]
Comment 11•14 years ago
|
||
(In reply to comment #10)
> We don't run the code through eval or evalInSandbox.
What is the status here? Sounds like you have a good idea of how to fix it
Updated•14 years ago
|
Whiteboard: [hard blocker] → [hardblocker]
Assignee | ||
Updated•14 years ago
|
Whiteboard: [hardblocker] → [hardblocker][eta: 1/13]
Assignee | ||
Comment 12•14 years ago
|
||
Here is a one-liner solution. I don't know the javascript-version-autodetect code very well (I used to think chrome just gets "latest"), but cleary the js version for the xpinstall-confirm-dialog is < 1.7 if not specified explicitly.
Soon I'll post the evalInSandbox-based solution, which is somewhat ugly but much more correct IMO. While both solutions aren't risky IMO, I guess smaller is better this late in the game.
Attachment #505179 -
Flags: review?(dtownsend)
Assignee | ||
Updated•14 years ago
|
Whiteboard: [hardblocker][eta: 1/13] → [hardblocker]
Assignee | ||
Comment 13•14 years ago
|
||
This patch fixes any potential caller, not just xpinstall. I like it more, you might not.
Unfortunately, both options are bad in the same way: we'll have to update this number every once in a while. :-/
Attachment #505191 -
Flags: review?(dtownsend)
Comment 14•14 years ago
|
||
Comment on attachment 505191 [details] [diff] [review]
the other option
Yeah I prefer this option, feels like it is more likely to cover all the bases, looks like you should use the version "ECMAv5" for now though as the latest version. I've filed bug 627196 on allowing us to just fix the string to something that means latest version here but I think this fix is good enough to ship with.
Is there anyway to test this?
Attachment #505191 -
Flags: review?(dtownsend) → review+
Updated•14 years ago
|
Attachment #505179 -
Flags: review?(dtownsend) → review-
Assignee | ||
Comment 15•14 years ago
|
||
But it doesn't, and I have no idea why. I suppose we face some sandbox-mess here (maybe I should have created the install object within the sandbox context? I cannot tell how far this goes...). Anyhow, we shouldn't spent more time on this IMO.
Comment 16•14 years ago
|
||
(In reply to comment #15)
> Created attachment 505237 [details] [diff] [review]
> A test? something along these lines should have worked
>
> But it doesn't, and I have no idea why. I suppose we face some sandbox-mess
> here (maybe I should have created the install object within the sandbox
> context? I cannot tell how far this goes...). Anyhow, we shouldn't spent more
> time on this IMO.
Yeah you're probably right, let's get it landed
Updated•14 years ago
|
Whiteboard: [hardblocker] → [hardblocker][has patch][has review][can land]
Updated•14 years ago
|
Keywords: checkin-needed
Assignee | ||
Updated•14 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 17•14 years ago
|
||
Attachment #505179 -
Attachment is obsolete: true
Attachment #505191 -
Attachment is obsolete: true
Attachment #505237 -
Attachment is obsolete: true
Assignee | ||
Comment 18•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [hardblocker][has patch][has review][can land] → [hardblocker]
Comment 19•14 years ago
|
||
Edward, I'm sadly still not able to reproduce this bug in older builds. Would you have a minute to test if this issue is fixed for you now? Thanks.
Reporter | ||
Comment 20•14 years ago
|
||
I can reproduce in Firefox 4 Beta 9 using the STR in comment 0. (With the addition of extensions.checkCompatibility.4.0b = false as the original xpi I attached didn't have a maxver including b9.)
Verified fixed on nightlies.
Status: RESOLVED → VERIFIED
Target Milestone: --- → mozilla2.0b10
You need to log in
before you can comment on or make changes to this bug.
Description
•