Closed
Bug 584434
Opened 15 years ago
Closed 15 years ago
Or setTimeout or function apply(object) broken.
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: extensiondevelopment, Unassigned)
Details
Attachments
(1 file)
616 bytes,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
There is a problem of scope on mac, users don't get well defined functions or var. NOT reproducible on windows or linux. Seems to be a Mac problem.
//this should be alerting 'Works example 1'
var myObect = {};
myObect.function1 = function()
{
this.function2();
}
myObect.function2 = function()
{
alert('Works example 1');
}
setTimeout(function(){ myObect.function1(); }, 0);
//this should be alerting 'Works example 2'
var myOtherObject= {};
(function()
{
this.function1 = function()
{
this.function2();
}
this.function2 = function()
{
alert('Works example 2');
}
}).apply(myOtherObject);
setTimeout(function(){ myOtherObject.function1(); }, 0);
If a user on mac evaluates this code only gets the first alert, when the expected result should be the two alerts.
Reproducible: Always
Reporter | ||
Comment 1•15 years ago
|
||
None wants to confirm or mark as invalid?
Regards
![]() |
||
Comment 2•15 years ago
|
||
What happens if you turn jit off?
Assignee: nobody → general
Component: General → JavaScript Engine
Product: Firefox → Core
QA Contact: general → general
Version: unspecified → Trunk
![]() |
||
Updated•15 years ago
|
Version: Trunk → 1.9.2 Branch
Reporter | ||
Comment 3•15 years ago
|
||
Thanks Philip, I'm very bad reporting bugs.
I don't know what's jit and I don't have a mac :(
Learning new things, thanks,
https://wiki.mozilla.org/JavaScript:TraceMonkey
![]() |
||
Comment 4•15 years ago
|
||
There's no jit involved because there are no loops.
The testcase works for me (shows two alerts) with both Firefox 3.6 and current trunk on Mac OSX 10.5.
Reporter | ||
Comment 5•15 years ago
|
||
Thanks for looking into, I requested to a friend on Mac to test this.
Him response:
> After adding a few missing semi-colons, I got the first alert, but not the second. setTimeout has never been broken on Mac, so it must be something else.
But the second alert should be working, at least works on windows.
> The second alert only works while executing myOtherObject block alone.
I think him browser is
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.4) Gecko/20100527 Firefox/3.6.4
or maybe
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
There is lots of reports from mac users telling me that my extensions are not working. I think this block of code has something to do, as reported. Unfortunately I don't have a mac to debug this.
![]() |
||
Comment 6•15 years ago
|
||
Yes, the point is that I can't reproduce the problem on Mac. Can this friend of yours reproduce the problem on the testcase attached in comment 4? Can he do it in safe mode?
Comment 7•15 years ago
|
||
Tried testcase on
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
and
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b4) Gecko/20100818 Firefox/4.0b4
In both cases, both alerts appeared correctly.
Comment 8•15 years ago
|
||
Resolving as invalid. Probably an error I made when performing tests with Roberto regarding his add-on.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → INVALID
Reporter | ||
Comment 9•15 years ago
|
||
Ok I will throw a real example, just for the record, maybe someone is really curious about this.
This extension version https://addons.mozilla.org/en-US/firefox/addon/5372/versions/?page=1#version-2.100731.16
sort the tabs by URL, the menuitem appended to the context menu fires with a setTimeout, I guess that If I remove the setTimeout in the menuitem the extension works.
Currently the add-on is on sandbox because editor reported the following errors:
>The following files of Sort tabs 2.100731.16 have
>been retained in the sandbox by a Mozilla Add-ons editor:
>Review Information:
>Tested on Mac with Firefox
>Comments: The following errors were found
>in the Error Console while testing your add-on:
>Error: this.decodeUTF8Recursive is not a function
>Source File: chrome://sorttabs/content/js/_main.js
>Line: 202
>Error: this.htmlEntityDecode is not a function
>Source File: chrome://sorttabs/content/lib/documents.js
>Line: 11
You need to log in
before you can comment on or make changes to this bug.
Description
•