This mostly requires some test suite work.
Created attachment 642506 [details] [diff] [review]
Fixes most of mochitest.
Omits jstests for e4x (need to add target to testing makefile)
Working through obvious errors in other js reftests
Created attachment 642794 [details] [diff] [review]
Patch for e4x tests
-Change to testing/testsuites-targets.mk to run e4x tests as a second pass (Concerned about the error reporting on the try servers)
-jsreftests changed to pass as many syntax related e4x calls as possible. There are errors. See attachement UnexpectedChanges.text
Created attachment 642795 [details]
// While trying to save an alternate preference set and reload it
// Discovered this can make things crash
Services.prefs.resetPrefs(); // Crashes on this line
// Not sure that the save and read are needed
// 2) runreftests.py parameter has strange behavior
// extra-profile-file did not work unless the file is user.js
Created attachment 643710 [details] [diff] [review]
Patch using |reftest| header to run tests
Created attachment 643984 [details] [diff] [review]
Fixed mochitests and jsreftests
(root)/js/src/tests/js1_6/Regress/regress-314887.js fails. Needs work.
Ted, can you please make sure you patches have the needed metadata so that they're easier to eventually check in? Thanks!
Created attachment 644413 [details] [diff] [review]
Patch with metadata for easier checkin
Ryan, I think this patch has the metadata you needed for easier checkin.
(In reply to ted shroyer from comment #8)
> Created attachment 644413 [details] [diff] [review]
> Patch with metadata for easier checkin
> Ryan, I think this patch has the metadata you needed for easier checkin.
Much better, thanks! One note, this patch is pretty self-explanatory based on the bug title, but typically you'll want a commit message that's succinctly describing what the patch is doing. You don't need to worry about that for this one, though.
Comment on attachment 644413 [details] [diff] [review]
Patch with metadata for easier checkin
Review of attachment 644413 [details] [diff] [review]:
r=me with a few minor changes, described below.
In these three files:
please use \n\ instead of plain \.
These are tests we are not going to delete when E4X goes, so I have a feeling it'd be rude of us to change the meaning of the code in these tests any more than we have to.
(The only way this would ever matter practically is that if the test ever suddenly started failing with a parse error, the parse error line number would be something meaningful instead of
just always being 1. So not a huge deal. It might never happen.)
>+// E4X NEEDS WORK
Oops. This doesn't need debugging, it just needs the E4X pref turned on. (I told you it didn't, but I was wrong.)
> var BUGNUMBER = 314887;
> var summary = 'Do not crash when morons embed script tags in external script files';
Still my favorite bug summary ever.
@@ +1,1 @@
Huh, you added one more space character here than in the other files. I don't care about the space, as long as it works.
@@ +31,5 @@
> + setAllowXML(default_allow_xml);
> +var uneval_xml = uneval(eval('<test />'));
But this is one of the tests we *do* want to delete, so it'll be all right.
If you want we can debug this and figure out why the pref doesn't take effect when we expected. I'm not super worried about it, but I'd like to know.
@@ +682,4 @@
This change shouldn't be landed at the same time as all the test fixes. The test fixes should land first, without toggling this pref. So please take it out of the patch.
Tomorrow or Tuesday we can send an updated patch to the Try server.
Ted mentioned that using pref() in js-tests causes js/src/tests/lib/manifest.py to spit out a few warnings. The parser in there needs to be updated to cope with pref(). Regexp hacking. :-P
Created attachment 645120 [details] [diff] [review]
Should contain changes for jorendorff's comments and deal with recent removal of some test cases
Very pretty green Try Server run you probably can't see:
Created attachment 646257 [details] [diff] [review]
Weirdness, part 1 - without SpecialPowers, things work
This patch shows that two existing tests can be made to pass even if the pref is off by default. You just have to turn it on first.
However it's really fragile and unpredictable. I think there's something wrong with the pref. The next patch will show one strange way to make the tests fail.
Created attachment 646259 [details] [diff] [review]
Weirdness, part 2 - with SpecialPowers, the pref doesn't take effect
Just switching from enablePrivilege to SpecialPowers is enough to make the pref not take effect. Very strange.
OK. There are multiple parts to the strangeness.
One weird thing is that `eval('<x/>')` is different from plain `<x/>`. From just a plain sanity standpoint this Should Not Be. The bug is that overrideVersion stomps on the language version and options. For direct eval code, that stuff should be inherited from the calling script regardless of what else is on the stack.
That's a bug. To me versionOverride is crazy from top to bottom; I can't imagine what that is supposed to be for.
But I say we land this patch and fix versionOverride later, perhaps after deleting E4X.
Comment on attachment 645120 [details] [diff] [review]
The technique this patch uses to fix the two js/xpconnect mochitests is definitely sketchy. I don't see a better way, though, only other equally ugly workarounds. Let's do it. r=me.
OK, this bug is about the test suite. The patch has landed.
Filed bug 778851 for the rest.