Bug 833208 (part 1) - Remove e4x support from jit-tests. r=jwalden.

--HG--
rename : dom/browser-element/BrowserElementParent.jsm => dom/browser-element/BrowserElementParent.js
rename : js/src/jit-test/tests/e4x/bug613151.js => js/src/jit-test/tests/basic/bug613151.js
rename : js/src/jit-test/tests/e4x/bug651966.js => js/src/jit-test/tests/basic/bug651966.js
rename : js/src/jit-test/tests/e4x/bug737251.js => js/src/jit-test/tests/basic/bug737251.js
extra : rebase_source : 2102a879231490bf1b73249b4889c2d83c73010f
This commit is contained in:
Nicholas Nethercote 2013-01-28 14:25:14 -08:00
parent da4d7ac589
commit 73f7dab4ed
67 changed files with 42 additions and 294 deletions

View File

@ -35,6 +35,3 @@ if (!("verifypostbarriers" in this)) {
if (!("gcPreserveCode" in this)) {
gcPreserveCode = function() { }
}
if ("options" in this)
options("allow_xml");

View File

@ -1,8 +0,0 @@
// |jit-test| error:TypeError
// Binary: cache/js-dbg-64-6fc5d661ca55-linux
// Flags:
//
x = /x/
x.__proto__ = new Namespace
x > 0

View File

@ -1,12 +0,0 @@
// Binary: cache/js-dbg-64-c338f8b7371e-linux
// Flags: -j
//
(function(){
(eval("\
(function(){\
if(XML('aa'.replace(/a/g,function(){for(l in[0,0,0]){\
print(this)\
}}))){('')}\
})\
"))()
})()

View File

@ -9,7 +9,7 @@ ox1 = wrap(o);
}
f5(o9);
f5(o13);
var o0 = XMLList;
var o0 = [];
function f3(o) {
var prop = Object.getOwnPropertyNames(ox1)[0];
if (prop) { Object.defineProperty(ox1, prop, {configurable: true,enumerable: true,unused: 1 }); }

View File

@ -10,5 +10,5 @@ function Engineer(name, projs, machine) {
this.base(name, "engineering", projs)
this.machine = machine || "";
}
Engineer.prototype = new XMLList();
Engineer.prototype = {};
var les = new Engineer("Morris, Les", new Array("JavaScript"), "indy");

View File

@ -1,8 +0,0 @@
// |jit-test| error:TypeError
// Binary: cache/js-dbg-64-fecae145d884-linux
// Flags:
//
const [ QName, [] ] = ['a b','c d'];
var xmlOl = new XML('foo');

View File

@ -9,6 +9,6 @@ try {
for (var icount = 0; icount < 25; ++icount, let(icount2, printStatus) (function() gczeal(2))[1]++)
str = str + str;
} catch(ex) {
new XML( str, false, (new RegExp('[0-9]{3}')).test('23 2 34 78 9 09'));
new Date( str, false, (new RegExp('[0-9]{3}')).test('23 2 34 78 9 09'));
}
this.toSource();

View File

@ -77,7 +77,6 @@ function toPrinted(value) value=value.replace(/\\\\n/g, 'NL').replace(/[^\\x20-\
");
lfcode.push("\
var summary = 'Regression test for bug 385393';\
var current = isXMLName({});\
var expect = 'No Crash';\
reportCompare(expect, actual, summary);\
");

View File

@ -1,12 +0,0 @@
// |jit-test| slow;
try {
x = <x><y/></x>
x += /x /
} catch (e) {}
for each(a in [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0]) {
x += x;
}
default xml namespace = x;
<x></x>

View File

@ -1,4 +1,4 @@
// Iterating over a property with an XML id.
// Iterating over a property with an Array id.
function n() {}
function g() {}
eval("\
@ -7,7 +7,7 @@ eval("\
for (w in this) {}\
Object.defineProperty(\
this, \
new QName, \
new Array, \
({enumerable: true})\
)\
}\

View File

@ -3,7 +3,7 @@ function f1() {
function f2() {
}
function f3(o) {
f2 = XML.prototype;
f2 = Date.prototype;
}
var key = Object.getOwnPropertyNames(f1)[30];
if(key) {

View File

@ -20,7 +20,6 @@ delete Math;
delete Number;
delete String;
delete Regexp;
delete XML;
delete Reflect;
delete Proxy;
delete Error;
@ -50,7 +49,6 @@ failWrapper(function () { Math; });
failWrapper(function () { Number; });
failWrapper(function () { String; });
failWrapper(function () { Regexp; });
failWrapper(function () { XML; });
failWrapper(function () { Reflect; });
failWrapper(function () { Proxy; });
failWrapper(function () { Error; });
@ -83,7 +81,6 @@ failWrapper(function () { Math; });
failWrapper(function () { Number; });
failWrapper(function () { String; });
failWrapper(function () { Regexp; });
failWrapper(function () { XML; });
failWrapper(function () { Reflect; });
failWrapper(function () { Proxy; });
failWrapper(function () { Error; });

View File

@ -1,2 +1,2 @@
delete(0).__proto__.valueOf
eval("(function(){(0).valueOf();<x/>})")()
eval("(function(){(0).valueOf();})")()

View File

@ -1,6 +1,6 @@
function test(s) {
eval(s);
let (a = <p/>.q = 0, x = x)
let (a = ({}).q = 0, x = x)
assertEq(x, 5);
}
test('var x = 5;');

View File

@ -1,4 +1,4 @@
try { let(x = XMLList(7), y = let(a = x)("")) {} } catch (e) {}
try { let(x = Date(7), y = let(a = x)("")) {} } catch (e) {}
try {
with({

View File

@ -19,14 +19,14 @@ f();
f();
f();
f();
try { f("<x/>.(x=[]);function x(){}(x())"); } catch (e) {}
try { f("function x(){}(x())"); } catch (e) {}
function f2() {
a = {
x
} = x, (x._)
function
x()( * :: * )
x()({})
}
try { f2(); } catch (e) {}

View File

@ -3,7 +3,7 @@ done = false;
try {
function x() {}
print(this.watch("d", Object.create))
var d = <x></x>
var d = {}
} catch (e) {}
try {
eval("d = ''")

View File

@ -1,7 +1,6 @@
Function.prototype.__proto__["p"] = 3
c = [].__proto__
c[5] = 3
Namespace.prototype.__proto__[4] = function() {}
gc()
Function("\
{\

View File

@ -1,3 +1,3 @@
Object.defineProperty(Namespace.prototype, "toString", {
Object.defineProperty(Array.prototype, "toString", {
enumerable: true
})

View File

@ -1,5 +1,5 @@
a = {}
a.getOwnPropertyDescriptor = XML;
a.getOwnPropertyDescriptor = Array;
b = Proxy.create(a)
for (x in this)
try {

View File

@ -13,7 +13,7 @@ try {
} catch (e) {}
try {
(function() {
n.(O)
true
}())
} catch (e) {}
try {

View File

@ -1,11 +1,5 @@
load(libdir + "asserts.js");
function xmlAllowed() {
return (typeof options == "function") &&
(options() + "").contains("allow_xml");
}
var valid_strict_funs = [
// directive ends on next line
function () {
@ -56,7 +50,7 @@ var invalid_strict_funs = [
"use strict"
();
},
...(xmlAllowed() ? [Function("'use strict'\n..not")] : []),
...([]),
...[Function("'use strict'\n " + op + " 'not'") for (op of binary_ops)],
];

View File

@ -1,6 +0,0 @@
// don't assert
for (a = 0; a < 9; ++a) {
M: for (let c in <x>></x>) {
break M
}
}

View File

@ -9,7 +9,7 @@ function testCaseTypeMismatchBadness()
break;
case "":
case <x/>:
case {}:
break;
}
}

View File

@ -1,5 +1,5 @@
function testDeepBail1() {
var y = <z/>;
var y = [1,2,3];
for (var i = 0; i < 9; i++)
"" in y;
}

View File

@ -1,6 +0,0 @@
// Bug 462027 comment 54.
function testInterpreterReentery8() {
var e = <x><y/></x>;
for (var j = 0; j < 4; ++j) { +[e]; }
}
testInterpreterReentery8();

View File

@ -56,9 +56,6 @@ test("a", 2, "q = function (a) { (function (b) { h(); a = b; })(2); h(); }; q(1)
test("a", 2, "q = function (a) { h(); return function (b) { h(); a = b; }; }; q(1)(2);");
test("n", 3, "q = function (n) { for (var i = 0; i < n; i++) { let (j = i) { h(); } } }; q(3);");
// Don't crash in E4X filter scopes.
test("x", 2, "q = function () { var x = <><y/><z/></>.(function (e) { h(); }(this)); }; q();");
// A function with long dynamic and static chains.
var N = 80;

View File

@ -1,11 +0,0 @@
x = <x/>
try {
Function("\
(function f() {\
({x:{b}}=x);\
f.apply(null, new Array(100))\
})()\
")()
} catch (e) {
assertEq(e.message, "too much recursion");
}

View File

@ -1,11 +0,0 @@
x = <x/>
try {
Function("\
(function f() {\
({x}=x);\
f.apply(null, new Array(100))\
})()\
")()
} catch (e) {
assertEq(e.message, "too much recursion");
}

View File

@ -1,10 +0,0 @@
x = <x/>
try {
Function("\
for(var a = 0; a < 6; a++) {\
Number(x.u)\
}\
")()
} catch (e) {
assertEq(e.message, "too much recursion");
}

View File

@ -1,4 +0,0 @@
x = <x/>
for (var z = 0; z < 4; z++) {
print(x.z)
}

View File

@ -1,4 +0,0 @@
x = <x/>;
for each(l in [0, 0, 0, 0]) {
delete x.d;
}

View File

@ -1,4 +0,0 @@
for (p = 0; p < 4; p++) {
a = 0
new XMLList
}

View File

@ -1,23 +0,0 @@
/* All versions >= 1.6. */
function syntaxErrorFromXML() {
try {
var f = new Function('var text = <![CDATA[aaaaa bbbb]]>.toString();');
return false;
} catch (e if e instanceof SyntaxError) {
return true;
}
}
version(150);
assertEq(syntaxErrorFromXML(), true);
revertVersion();
for (vno in {160: null, 170: null, 180: null}) {
print('Setting version to: ' + vno);
version(Number(vno));
assertEq(syntaxErrorFromXML(), false);
revertVersion();
}
print('PASS!')

View File

@ -1,10 +0,0 @@
function foo() {
var name = 2;
var x = <a><name>what</name></a>;
var y = "" + x.(name != 2);
assertEq(y.match(/what/)[0], "what");
var z = "" + x.(name = 10);
assertEq(z.match(/10/)[0], "10");
}
foo();

View File

@ -1,6 +0,0 @@
// don't crash
x = <x/>
for (a = 0; a < 9; a++) {
x.elements()
}

View File

@ -1,7 +0,0 @@
// |jit-test| error: TypeError
(function() {
function::d = 0
d.(l)
function d() {}
})()

View File

@ -1 +0,0 @@
uneval(Function("[] = (*::*++);print(x);"));

View File

@ -1 +0,0 @@
for (let x in [<y/>.(let(x) function() {})]) {}

View File

@ -1 +0,0 @@
uneval(function() { @o() })

View File

@ -1,5 +0,0 @@
function g(s) {
return eval(s)
}
f = g("(function(){({x:function::arguments})})")
f()

View File

@ -1,5 +0,0 @@
function h(s) {
return eval(s)
}
f = h("(function(){function::arguments=[]})")
for (a in f()) {}

View File

@ -1,16 +0,0 @@
// XML syntax is not available unless JSOPTION_ALLOW_XML is enabled.
load(libdir + "asserts.js");
var exprs = ["<a/>", "x..y", "x.@id", "x.(@id === '13')", "x.*", "x.function::length",
"function::parseInt", "a::b"];
assertEq(options().split(",").indexOf("allow_xml") >= 0, true);
options("allow_xml"); // turn it off
for (var e of exprs)
assertThrowsInstanceOf(function () { Function("return " + e + ";"); }, SyntaxError);
options("allow_xml"); // turn it back on
for (var e of exprs)
assertEq(typeof Function("return " + e + ";"), "function");

View File

@ -1,24 +0,0 @@
// XML-specific classes do not resolve unless JSOPTION_ALLOW_XML is enabled.
assertEq(options().split(",").indexOf("allow_xml") >= 0, true);
options("allow_xml");
var xmlnames = ["XML", "XMLList", "isXMLName", "QName", "Namespace"];
for (var name of xmlnames)
assertEq(name in this, false);
var globals = Object.getOwnPropertyNames(this);
for (var name of xmlnames)
assertEq(globals.indexOf(name), -1);
var g = newGlobal('new-compartment');
for (var name of xmlnames)
assertEq(name in g, false);
// Turn it back on and check that the XML classes magically appear.
options("allow_xml");
assertEq("QName" in this, true);
globals = Object.getOwnPropertyNames(this);
for (var name of xmlnames)
assertEq(globals.indexOf(name) >= 0, true);

View File

@ -1,14 +0,0 @@
load(libdir + "asserts.js");
assertThrowsInstanceOf(function () {
eval("function f(a=<x/>) {}");
}, SyntaxError);
assertThrowsInstanceOf(function () {
eval("function f(a=<x/>) { 'use strict'; }");
}, SyntaxError);
assertThrowsInstanceOf(function () {
eval("function f(a=(function () { <x/> })) {}");
}, SyntaxError);
assertThrowsInstanceOf(function () {
eval("function f(a=(function () { <x/> })) { 'use strict'; }");
}, SyntaxError);

View File

@ -1,6 +0,0 @@
function f()
{
var x = <><arguments/><arguments/></>;
x..arguments;
}
f();

View File

@ -1,11 +0,0 @@
var o = {};
o.__defineGetter__(<x/>,function(){});
<a b="2"/>.(o.__defineGetter__(new QName("foo"), function(){}));
var i = 0;
for (w in o) {
++i;
}
assertEq(i, 2);

View File

@ -5,5 +5,5 @@ function WeekDay( t ) {
}
var expect = 'No Error';
for (var i = 0; i < 50; i++) {
var [] = expect ? WeekDay( i.a ) : isXMLName.anonymous(i), uneval;
var [] = expect ? WeekDay( i.a ) : true, uneval;
}

View File

@ -1,7 +0,0 @@
function TEST(section, expected, actual) {}
function TEST_XML(section, expected, actual) {
return TEST(section, expected, actual.toXMLString());
}
x = new XML("");
TEST_XML(2, "", x);
TEST_XML(3, "", x);

View File

@ -2,7 +2,7 @@
function fannkuch() {
for (var j = 0; j < 50; j++) {
for (var i = 0; i < 0; i++) {
arguments, XML;
arguments, Array;
}
}
}

View File

@ -3,7 +3,7 @@ function TestCase(n, d, e, a) {
this.bugnumber = typeof(BUGNUMER) != 'undefined' ? BUGNUMBER : '';
this.type = (typeof window == 'undefined' ? 'shell' : 'browser');
gTestcases[gTc++] = this;
if (optionName && optionName != "allow_xml") {}
if (optionName) {}
{} {} {} // Seems to be required to crash
}
function f() {}

View File

@ -36,7 +36,7 @@ function getException(f) {
function thrower2(x) {
if (x > 90)
throw x;
with (<a>foo</a>) {}; // Abort compilation...
with ({}) {}; // Abort compilation...(?)
}
function test2() {
for (var i = 0; i < 100; i++) {

View File

@ -3,7 +3,7 @@
for(var z = 0 ; z < 2 ; ++z) {\
this\
}\
", (<x/>))
", ([1,2,3]))
})()
/* Don't crash. */

View File

@ -1,6 +1,6 @@
// |jit-test| allow-oom
(function(){
(x)=<x>></x>
(x)=[1,2,3]
})()
try{
(function(){

View File

@ -1,5 +1,5 @@
function K(x) {
var dontCompile = <a></a>;
with ({}); // prevent compilation
this.x = x;
}
function f() {

View File

@ -1,5 +1,4 @@
x = <x/>
default xml namespace = [];
x = (function() {})
(function () {
function a() {}
a([7].some(gc))

View File

@ -1,4 +1,4 @@
// |jit-test| error: <x/> is not a function
// |jit-test| error: [1, 2, 3] is not a function
function f() { (e)
} (x = Proxy.createFunction((function(x) {
return {
@ -10,5 +10,5 @@ function f() { (e)
for (z = 0; z < 100; x.unwatch(), z++)
for (e in [0]) {
gczeal(2)
} ( <x/>)("")
} ( [1,2,3])("")

View File

@ -1,6 +1,6 @@
try {
var x
for (x in <x>></x>)
for (x in [x])
gczeal(2)
new NaN
} catch(e) {}

View File

@ -12,7 +12,7 @@ try { (function() {
let(y)((function() {
try {
let(c) o
} finally { (f, *::*)
} finally { (f, [1,2,3])
}
}))
}))

View File

@ -1,5 +1,5 @@
/* Don't assert. */
x = <x/>
x = [1,2,3]
function f(aaa) {
aaa.e = x
}

View File

@ -1,9 +1,9 @@
/* vim: set ts=4 sw=4 tw=99 et: */
function J(i) {
/* Cause a branch to build. */
/* Cause a branch to build(?) */
if (i % 3)
<xml></xml>
[1,2,3]
}
function h(i) {
@ -16,8 +16,8 @@ function h(i) {
}
function g(i) {
/* Method JIT will try to remove this frame. */
if (i == 14) { <xml></xml> }
/* Method JIT will try to remove this frame(?) */
if (i == 14) { with ({}); }
return h(i);
}

View File

@ -20,7 +20,7 @@ function G(a, b, c, d, e, f) {
if (c) g = []
else c = h.concat([], [])
h.concat(g, d)
h.clamp(f, <x></x> )
h.clamp(f, [1,2,3])
}
function decrypt(a, b, c, d, e) {
G(a, 1, c, d, e, b)

View File

@ -1,10 +1,10 @@
function testXML(x, y) {
function testStuff(x, y) {
for (var i = 0; i < 60; i++) {
x[y]();
x[y];
}
}
testXML(<x/>, "elements");
testStuff({"elements":function(){}}, "elements");
var o = {
res: 0,

View File

@ -5,7 +5,6 @@ function f(x) {
}
function g(x) {
var a = <a></a>;
eval("what = true");
}

View File

@ -5,4 +5,4 @@ function t(code) {
t("");
t("");
t("");
t("this.function::a = 7;");
t("this.function = 7;");

View File

@ -1,5 +1,5 @@
try { with( <x/> ) {
try { with( {"a":1} ) {
(function () {
for (;;) {
t
@ -7,7 +7,7 @@ try { with( <x/> ) {
})()
} } catch (e) {}
with( <x/> ) {
with( {"b":2} ) {
(function () {
for (b = 0; b < 18; ++b) {}
})();

View File

@ -52,7 +52,7 @@ xfoo(function(a) { oglobal = a; return 10; }, [1]);
xfoo(function(a) { oglobal = a; return 10; }, [1]);
xfoo(function(a) { oglobal = a; return 10; }, [1]);
assertEq(oglobal, 1);
xfoo(function(a) { <x></x>; oglobal = a; return 3; }, [true]);
xfoo(function(a) { [1,2,3]; oglobal = a; return 3; }, [true]);
assertEq(oglobal, true);
// Recompilation out of SplatApplyArgs.