[prev in list] [next in list] [prev in thread] [next in thread] 

List:       htmlunit-develop
Subject:    [HtmlUnit] [ htmlunit-Bugs-2834335 ] Yahoo! Maps breaks Prototype
From:       "SourceForge.net" <noreply () sourceforge ! net>
Date:       2009-09-25 12:35:50
Message-ID: E1MrA1e-0007d6-Fm () h45xhf1 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Bugs item #2834335, was opened at 2009-08-09 02:26
Message generated for change (Comment added) made by mguillem
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=448266&aid=2834335&group_id=47038

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: Latest code in SVN
> Status: Closed
> Resolution: Fixed
Priority: 5
Private: No
Submitted By: Erik Ostrom (eostrom)
Assigned to: Marc Guillemot (mguillem)
Summary: Yahoo! Maps breaks Prototype under HtmlUnit/Rhino

Initial Comment:
Prototype.js adds methods such as .first() to Array's prototype. If Prototype is \
loaded and then Yahoo! Maps is used, those added methods become unavailable.

I'm attaching a small HTML file that reproduces the error, retrieving the relevant \
libraries from the net. The test case uses Mapstraction, but it's a fairly thin layer \
around Yahoo! Maps; the specific line that makes things break calls Yahoo!'s \
Map.drawZoomAndCenter. (That is, if you comment out that line in mapstraction.js, \
Prototype works again. However, then you don't have a map.)

Some things I've learned about this error:

  * It occurs in HtmlUnit emulating Firefox, but not in Firefox 3.5.2.
  * It occurs with Yahoo! Maps, but not with OpenLayers.
  * It affects Prototype methods on Array, but not those on String.
  * It occurs after Yahoo! Maps is used, not before.
  * It doesn't occur if Yahoo! Maps is simply loaded; you have to actually initialize \
a map.

For the sake of completeness, here's some info about the test environment I'm using:

  * langalex-culerity-0.1.7
  * jarib-celerity-0.0.6.14
  * htmlunit-2.6-SNAPSHOT.jar (bundled with celerity)
  * htmlunit-core-js-2.6-SNAPSHOT.jar (ditto)
  * (also tried snapshot jars from celerity repository, 08-07-2009)
  * Mapstraction v1.latest
  * Yahoo! Maps 3.8
  * Prototype.js 1.6.0.3
  * Rails 2.3.2
  * Ruby 1.8.6 (p287)
  * JRuby 1.3.1
  * Java 1.5.0_19
  * OS X 10.5.7

However, I strongly suspect it's reproducible using only HtmlUnit/Rhino, the attached \
HTML file, and the JavaScript libraries it references (no Ruby, Rails, or Celerity).


----------------------------------------------------------------------

> Comment By: Marc Guillemot (mguillem)
Date: 2009-09-25 14:35

Message:
Now fixed with latest snapshot of htmlunit-core-js.

----------------------------------------------------------------------

Comment By: Marc Guillemot (mguillem)
Date: 2009-08-14 16:19

Message:
Opened Rhino bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=510504

----------------------------------------------------------------------

Comment By: Marc Guillemot (mguillem)
Date: 2009-08-13 23:04

Message:
This looks like a bug in Rhino. Following code shows the problem. Too late
for today to do more than to add this info here ;-)

<html>
<body>
<script>
Array.prototype.foo = function() { alert("hello")};

[].foo();
var x = []
for (var i in x)
{
	alert(i)
	delete x[i]
}
[].foo();
</script>

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=448266&aid=2834335&group_id=47038

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
HtmlUnit-develop mailing list
HtmlUnit-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic