Closed Bug 523234 Opened 16 years ago Closed 15 years ago

Particular webpage (assume javascript problem) differs from IE result (cells don't populate)

Categories

(Tech Evangelism Graveyard :: English US, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: keepitsimplestupid, Unassigned)

References

()

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729) Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729) Cells don't populate with results like Internet explorer does. Reproducible: Always Steps to Reproduce: Go here: http://www.electrician2.com/calculators/wireocpd_ver_1.html Type '50' in the continuous load box Click on the first "Click to calculate below outputs" Compare with Internet Explorer Code is copyrighted, so it's not produced here
I can indeed reproduce the issue (on Windows Vista) with latest trunk, but it appears to work fine with Google Chrome and Opera. I see the following error in the console: Error: wiresizecu is not defined Source File: http://www.electrician2.com/calculators/wireocpd_ver_1.html Line: 633
Keywords: qawanted
Version: unspecified → Trunk
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20090301 Shiretoko/3.1b3pre I see the same error in the console : Error: wiresizecu is not defined Source File: http://www.electrician2.com/calculators/wireocpd_ver_1.html Line: 633
Also see the same error - was going to mark as TE but the site works in IE, Safari, Chrome and Opera... wiresizecu is a JavaScript function that is defined at line 946
I don't know enough about JS and I don't know a triager/QA person who could help :-( This testcase works in IE8 and Chrome10 but it doesn't work in FF3.6.13 or SM trunk - confirming and moving to JS Engine.
Assignee: nobody → general
Status: UNCONFIRMED → NEW
Component: General → JavaScript Engine
Ever confirmed: true
Product: Firefox → Core
QA Contact: general → general
Attached file Minimalish testcase
I believe this is a known jseng issue, but don't know the bug number offhand.
Note that having the function statement inside a branch of a conditional seems to be required, as does having it come after the attempt to call the function.
Keywords: qawanted
Whiteboard: DUPEME
Bug 615065 or bug 620838, seems to me -- I think the latter might be the right one of the two, not concerned enough to categorically determine this.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
Former, I meant!
No, I don't think so... This bug is still happening on TM tip (whereas both of the bugs in comment 7 are fixed-in-tracemonkey), and happens with methodjit disabled too.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Function "statement" inside a conditional is an extension to ECMA-262, all editions, and we've always treated it as a conditional function, defined only if control flow reaches the sub-statement. This differs from IE and browsers that follow IE. We're not changing, and ECMA-262 in a Harmony future edition will make function in a braced block be scoped within that block, with the binding hoisted to top of block, so what IE and cronies do isn't going to stick. The site needs to be fixed to avoid this extension or use intersection semantics. /be
Status: REOPENED → RESOLVED
Closed: 15 years ago15 years ago
Resolution: --- → DUPLICATE
IE just lets the last function substatement in source order bind the name. So if (DEBUG) { function f() { return "win"; } } else { function f() { return "lose"; } } always loses when debugging. /be
Well, if the binding is hoisted to top of block the site will start working, no? My reduced testcase is faithful in that regard: the function invocation is in the same block as the function declaration, just before the declaration. Should this bug track implementing that? Or should we have a separate bug for said tracking? Should this bug be an evang bug for the site?
And the IE behavior is presumably why the site in questions has functions called "wiresizecu" and "wiresizeal" for copper and aluminum respectively, in the different branches of the "what kind of metal is your conductor made of" if statement instead of calling them both "wiresize"... ;)
If we do want to evangelize, electrician@electrician2.com seems to be like the right address to try.
The Harmony specs aren't drafted, let alone finalized, so we don't want to make this bug be about implementing them to get this site working -- SpiderMonkey in current, near-term, and old releases of Mozilla browsers needs the site fixed. The bug to make functions declared in block statements block-local, hoisted, is bug 585536. /be
OK, so it sounds like we're not planning to go the block-local + hoisted route outside of harmony or strict mode? In other words, implementing that won't affect this ite at all, right?
(In reply to comment #16) > OK, so it sounds like we're not planning to go the block-local + hoisted route > outside of harmony or strict mode? In other words, implementing that won't > affect this ite at all, right? Not sure -- we might just change all versions, but later, indefinite but not soon enough to save the day here. If there were lots of sites like this one, maybe. In all the years that we've been accumulating dups (444853 is not the oldest bug, just the best target I found in a hurry), the content has not been so easy to make work by hoisting to block-top. /be
https://bugzilla.mozilla.org/show_bug.cgi?id=523234#c11 Comment 11, if correct seems to have nailed it, but I do agree that Firefox's behavior of undefined makes more sense. I'm not sure you want a "Compatibility mode" or "Do it the IE way mode" either. It's almost like the problem when Ben Franklin got the sign of the electron wrong and we have "conventional current" and "electron flow". Sometimes you care. I guess the odd part about this is that you have no idea that there are errors, warnings, or messages from the page, hence you THINK the site is working. This is not good. I'm going to at least propose a mechanism of warning the user that there are messages. Thinking simplisticly, next to where you show the identity info, you could show the symbols from warning, messages and errors. When you "mouse over" that symbols, it would just say "See Tools/Error Console" for more information. Errors could even turn the URL bar red for instance. Not knowing that there is a problem is a problem. I propose that "not knowing there is a problem" be made a separate bug.
KISS -- thanks for the thoughtful comment. If we had time we could try to detect code depending on IE behavior and warn. I will think about it over the holiday weekend. Happy New Year! /be
OK, sounds like we should contact the site and ask them to fix by relocating the fuction definition. Reporter, if you're a customer of the site, can you try contacting them? Or should I?
Assignee: general → english-us
Status: RESOLVED → REOPENED
Component: JavaScript Engine → English US
Product: Core → Tech Evangelism
QA Contact: general → english-us
Resolution: DUPLICATE → ---
Version: Trunk → unspecified
Whiteboard: DUPEME
That might be harder. I was thinking something more on the line of adding a small box with the symbol of the worst error found on the page whether it be informational, warning or errors. i.e. If the warning was found on the page, the yield sign would be used. Mousing over would tell you to look at the error console.
Boris. You can probably explain better what's required to fix. I've used the sites calculators before and that's how I found it. There are probably other calculators on the site are affected too. I think there are like 26 of them. Someone has to see if the calculators return the same result in each browser or use each of the calulators and examine the error console in Firefox. It could mean that the author knows of the problem, but doesn't know the issue and just tells everyone to use IE.
OK, I contacted the site.
Talked to the site author. I sent him a fixed version of the script, and it's been deployed on the above page. So things should work now.
Status: REOPENED → RESOLVED
Closed: 15 years ago15 years ago
Resolution: --- → FIXED
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: