Bug 48377 - REGRESSION: r69429-r69611: Javascript parse and reference errors on Amazon Lightning deals
Summary: REGRESSION: r69429-r69611: Javascript parse and reference errors on Amazon Li...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Evangelism (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P1 Normal
Assignee: Nobody
URL: http://www.amazon.com/gp/goldbox/ref=...
Keywords: InRadar
: 50436 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-10-26 14:38 PDT by Kevin M. Dean
Modified: 2011-01-20 21:38 PST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin M. Dean 2010-10-26 14:38:10 PDT
When viewing the link above (Amazon's Today's Deals link), the Lightning deals box at the upper right no longer appears.

Under r69611, the Web Inspector console reads:

SyntaxError: Parse error    gbld_js-v19._V198980857_.js:4612
ReferenceError: Can't find variable: GBLD    ref=cs_top_nav_gb27:2354

Under r70429, the Web Inspector console reads:

ReferenceError: Strict mode forbids implicit creation of global property 'Deal'    gbld_js-v19._V198980857_.js:371
ReferenceError: Can't find variable: Deal    ref=cs_top_nav_gb27:2397


This may be related to a crash issue that I'm also seeing between the same webkit nightly releases at Bug 47573 .
Comment 1 Geoffrey Garen 2010-10-27 18:04:15 PDT
<rdar://problem/8603250>
Comment 2 Oliver Hunt 2010-10-27 18:07:59 PDT
Amazon is providing incorrect strict mode code.
Comment 3 Oliver Hunt 2010-10-27 18:13:56 PDT
This isn't a regression, this is a progression.
Comment 4 Kevin M. Dean 2010-10-27 18:20:53 PDT
Incorrect strict mode or not, it renders in every other browser fine, so why does it break here?
Comment 5 Oliver Hunt 2010-10-27 18:21:36 PDT
(In reply to comment #4)
> Incorrect strict mode or not, it renders in every other browser fine, so why does it break here?

Because no other browser implements strict mode yet.
Comment 6 Kevin M. Dean 2010-10-27 18:28:49 PDT
But isn't there a more elegant fallback than erroring out and not rendering anything, or is it pretty much all or nothing to do it right?
Comment 7 Kevin M. Dean 2010-10-27 18:36:38 PDT
I guess it doesn't matter much for me at the moment since I can't use the recent nightlies anyway due to the constant crashing bug that I mentioned in my other Bug report. I'd really like to see that one fixed in case it has some effect on this one.
Comment 8 Oliver Hunt 2010-10-27 19:25:15 PDT
(In reply to comment #6)
> But isn't there a more elegant fallback than erroring out and not rendering anything, or is it pretty much all or nothing to do it right?

No.  It's not that we're choosing not to render their content, the problem is that they are attempting to build up the page from javascript and that javascript is wrong.  We can't choose not to follow the spec a fundamental behaviour in the spec.
Comment 9 Zoltan Herczeg 2010-10-27 23:36:48 PDT
Did you notify Amazon about this issue? What is their opinion?
Comment 10 Oliver Hunt 2010-10-28 08:47:21 PDT
(In reply to comment #9)
> Did you notify Amazon about this issue? What is their opinion?

W#e don't have any contacts inside amazon that i'm aware of.  The reality of matter is that their opinion isn't important.  Their code is wrong.  To make it work we would have to remove strict mode entirely which would basically neuter ES5.
Comment 11 Oliver Hunt 2010-10-28 08:58:40 PDT
(In reply to comment #9)
> Did you notify Amazon about this issue? What is their opinion?

And this will also break in firefox nightlies in the near future (if it hasn't already)
Comment 12 Kevin M. Dean 2010-10-28 09:01:31 PDT
I think it's more about informing Amazon that they have a broken implementation that they need to fix rather than having them asking Webkit to change. I wouldn't know who to contact there either. Would webmaster@amazon.com be an old-school guess?
Comment 13 Kevin M. Dean 2010-10-28 09:05:54 PDT
(In reply to comment #11)
> 
> And this will also break in firefox nightlies in the near future (if it hasn't already)

I just checked Minefield under Windows (Can't run the latest on my PPC Mac anymore) and you're right it's broken there as well.
Comment 14 Evan Martin 2010-10-28 09:10:13 PDT
I have engineer friends at Amazon.  I'll point them at this bug and see if they can route it to the appropriate people.
Comment 15 Zoltan Herczeg 2010-10-28 12:27:32 PDT
> W#e don't have any contacts inside amazon that i'm aware of.  The reality of matter is that their opinion isn't important.  Their code is wrong.  To make it work we would have to remove strict mode entirely which would basically neuter ES5.

Eh bugzilla... That question was not directed to you :)
Comment 16 Oliver Hunt 2010-10-29 10:10:54 PDT
(In reply to comment #14)
> I have engineer friends at Amazon.  I'll point them at this bug and see if they can route it to the appropriate people.

Any luck? Afaict we don't have any contacts at amazon :-(
Comment 17 Evan Martin 2010-10-29 10:53:23 PDT
He said he forwarded it.  Maybe they're looking at this conversation right now!
Comment 18 Oliver Hunt 2010-10-29 10:57:20 PDT
(In reply to comment #17)
> He said he forwarded it.  Maybe they're looking at this conversation right now!

dun dun duhhhhh!!!!
Comment 19 Dimitri Glazkov (Google) 2010-10-29 11:04:57 PDT
(In reply to comment #18)
> (In reply to comment #17)
> > He said he forwarded it.  Maybe they're looking at this conversation right now!
> 
> dun dun duhhhhh!!!!

Can I get a free Kindle?
Comment 20 Kevin M. Dean 2010-11-29 08:08:48 PST
(In reply to comment #14)
> I have engineer friends at Amazon.  I'll point them at this bug and see if they can route it to the appropriate people.

Evan, did you ever hear anything from Amazon?

This issue also affected Amazon's special Black Friday Week / Cyber Monday Lightning Deal pages.
Comment 21 Oliver Hunt 2010-11-29 08:54:02 PST
(In reply to comment #20)
> (In reply to comment #14)
> > I have engineer friends at Amazon.  I'll point them at this bug and see if they can route it to the appropriate people.
> 
> Evan, did you ever hear anything from Amazon?
> 
> This issue also affected Amazon's special Black Friday Week / Cyber Monday Lightning Deal pages.

Have you reported the bug to amazon?
Comment 22 Kevin M. Dean 2010-11-29 09:15:15 PST
(In reply to comment #21)
> Have you reported the bug to amazon?

Myself, no. I don't have any contacts there, but Evan said he did so I was just following up.
Comment 23 Alexey Proskuryakov 2010-12-06 14:53:41 PST
*** Bug 50436 has been marked as a duplicate of this bug. ***
Comment 24 Evan Martin 2010-12-06 15:04:23 PST
I pinged my Amazon contact again.  I'll let you know if he responds.
Comment 25 Edward Sabol 2010-12-07 09:46:42 PST
I understand not wanting to "neuter" ES5's strict mode, but I think this bug should be reopened with the component set to Evangelism. I filed a duplicate because I didn't find this "resolved" bug when I searched for both "Amazon" and "Lightning".
Comment 26 Alexey Proskuryakov 2010-12-07 09:53:13 PST
Indeed.
Comment 27 Evan Martin 2010-12-09 14:11:36 PST
Amazon contact says they're planning to work on it in January.

Personally, I think you should just blacklist Amazon from strict mode, but I'm into ugly hacks like that.  I.e. any page on amazon.com that requests strict mode they should instead get a console.log() that prints out a link to this bug.  That doesn't punish their users, but it will quickly get the attention of any developers who work on their site.
Comment 28 Oliver Hunt 2010-12-09 14:22:58 PST
(In reply to comment #27)
> Amazon contact says they're planning to work on it in January.
> 
> Personally, I think you should just blacklist Amazon from strict mode, but I'm into ugly hacks like that.  I.e. any page on amazon.com that requests strict mode they should instead get a console.log() that prints out a link to this bug.  That doesn't punish their users, but it will quickly get the attention of any developers who work on their site.

JavaScriptCore is independent of web pages, it's a large amount of work to add infrastructure to say "ignore the standard in this case", and it's counter productive.

Logging an error rather than entering strict mode essentially makes it impossible for amazon to actually check that their site is strict mode compliant when they do get round to trying fix it.  It's also a rather passive-aggressive response.
Comment 29 Evan Martin 2010-12-09 14:35:28 PST
I was just trying to suggest productive alternatives to the current behavior, which is failing to render their site.  But it's your call.
Comment 30 Kevin M. Dean 2010-12-29 09:49:42 PST
Lightning Deals are now appearing correctly for me in webkit.
Comment 31 Alexey Proskuryakov 2010-12-29 13:16:50 PST
Thanks for the update!
Comment 32 Jeff Walden (remove +bwo to email) 2011-01-20 21:38:27 PST
https://bugzilla.mozilla.org/show_bug.cgi?id=627531

Looks like Amazon fixed only the particular problem here and didn't address the root problem: that concatenating coordinating strict and non-strict scripts is no longer safe.  Is this second problem the only one that remains?  Who knows.  :-\

I suspect you want a new bug on this, but I'll leave that to someone else to file in case I'm wrong -- just noting it since I suspect people here would want to know about it.