[PATCH] Fix E4X test failure with new SpiderMonkey versions

Niko Tyni ntyni at debian.org
Sat Aug 21 17:56:48 UTC 2010


As of Mozilla 1.9.1.11, a pure XML element is not treated as valid
top level JavaScript but rather gets rejected with "XML cannot be the
whole program".

Work around this by throwing some valid JavaScript in the mix that
explicitly takes the value of the object.

See
 http://hg.mozilla.org/releases/mozilla-1.9.1/rev/d4b2224cf458
 http://hg.mozilla.org/releases/mozilla-1.9.1/rev/c4ba70070012
 https://bugzilla.mozilla.org/show_bug.cgi?id=375250
---
 t/26-e4x.t |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/26-e4x.t b/t/26-e4x.t
index de799fb..aeb9c8e 100644
--- a/t/26-e4x.t
+++ b/t/26-e4x.t
@@ -19,7 +19,7 @@ my $runtime = new JavaScript::Runtime();
 my $context = $runtime->create_context();
 
 my $ret = $context->eval(<<'EOP');
-<xml>this is an E4X object</xml>
+(<xml>this is an E4X object</xml>).valueOf();
 EOP
 is($ret, '<xml>this is an E4X object</xml>');
 
-- 
1.7.1


--dDRMvlgZJXvWKvBx--





More information about the pkg-perl-maintainers mailing list