Bug 799185 part 4 - Add tests for ReconstructPCStack. r=the-toad

This commit is contained in:
Nicolas B. Pierron 2012-11-22 16:09:15 -08:00
parent 81416a9d3f
commit c2caba3ae9
9 changed files with 225 additions and 0 deletions

View File

@ -0,0 +1,14 @@
options('strict')
f = (function() {
for (var z = 0; z < 9; ++z) {
x = z
}
try {
i
} catch (x if null) {
let e
} catch (l) {
x.m
}
})
for (a in f()) {}

View File

@ -0,0 +1,51 @@
function test(aLauncher) {
var result = null;
let prefs = 0;
let bundle = 1;
if (!bundle) {
// Check to see if the user wishes to auto save to the default download
// folder without prompting. Note that preference might not be set.
let autodownload = false;
try {
autodownload = !!autodownload;
} catch (e) { }
if (autodownload) {
// Retrieve the user's default download directory
let dnldMgr = 2;
let defaultFolder = 3;
try {
result = 42;
}
catch (ex) {
if (result == 12) {
let prompter = 4;
return;
}
}
// Check to make sure we have a valid directory, otherwise, prompt
if (result)
return result;
}
}
// Use file picker to show dialog.
var picker = 0;
if (picker) {
// aSuggestedFileExtension includes the period, so strip it
picker = 1;
}
else {
try {
picker = aLauncher.MIMEInfo.primaryExtension;
}
catch (ex) { }
}
return result;
}
test({});

View File

@ -0,0 +1,9 @@
// |jit-test| error: TypeError
function processNode(self) {
try {
if (self) return;
undefined.z;
} finally {
}
};
processNode();

View File

@ -0,0 +1,9 @@
function foo(aObject)
{
try { }
catch (ex if (ex.name == "TypeError")) { }
try { Object.getPrototypeOf(aObject); }
catch (ex) { }
}
foo(true);

View File

@ -0,0 +1,19 @@
function foo(aObject)
{
try {
try {
if (!aObject)
return;
}
catch (ex if (ex.name == "TypeError")) { }
finally {
}
undefined.x;
}
catch (ex if (ex.name == "TypeError")) { }
catch (ex if (ex.name == "TypeError")) { }
finally {
}
}
foo(true);

View File

@ -0,0 +1,19 @@
function f(a, b, c) {
while (a) {
let x;
if (b) {
if (c) {
d();
break; // hidden LEAVEBLOCK, then GOTO
}
break; // another hidden LEAVEBLOCK, then GOTO
}
}
null.x;
}
try {
f();
} catch (x) {
;
}

View File

@ -0,0 +1,73 @@
var y = undefined;
try {} catch (x) {
try {} catch (x) {
try {} catch (x) {
}
}
}
try {} catch (x if y) {
try {} catch (x if y) {
try {} catch (x if y) {
}
}
}
while (false) {
try {} catch ({x,y} if x) {
try {} catch ({a,b,c,d} if a) {
if (b) break;
if (c) continue;
}
} finally {}
}
Label1:
for (let foo = 0; foo < 0; foo++) {
Label2:
for (let bar = 0; bar < 0; bar++) {
if (foo) {
if (bar)
break Label2;
continue Label2;
} else {
if (bar)
break Label1;
continue Label1;
}
}
}
Label3:
for (let foo = 0; foo < 0; foo++) {
Label4:
for (let bar = 0; bar < 0; bar++) {
if (foo) {
if (bar)
continue Label4;
break Label4;
} else {
if (bar)
continue Label3;
break Label3;
}
}
}
switch (42) {
default:
try {} catch (x) {
if (x + 1) {
if (x)
break;
break;
}
}
break;
}
try {
null.x;
} catch (x) {
}

View File

@ -0,0 +1,19 @@
// |jit-test| error: TypeError
function testBitOrInconvertibleObjectInconvertibleObject() {
var o1 = {};
var count2 = 0;
function toString2() {
++count2;
if (count2 == 95) return {};
}
var o2 = { toString: toString2 };
try {
for (var i = 0; i < 100; i++)
var q = o1 | o2;
} catch (e) {
if (i !== 94)
return gc();
this.bar.foo ^ this
}
}
testBitOrInconvertibleObjectInconvertibleObject()

View File

@ -0,0 +1,12 @@
function f() {
try {} catch (x) {
return;
} finally {
null.x;
}
}
try {
f();
} catch (x) {}