Fix up the tests from bug 555246 to run when there's no evalcx function available.

This commit is contained in:
Robert Sayre 2010-04-04 09:41:11 -04:00
parent d447d924df
commit c95c882b76
2 changed files with 8 additions and 4 deletions

View File

@ -4,8 +4,11 @@
* Contributor: Jason Orendorff * Contributor: Jason Orendorff
*/ */
var cx = evalcx(""); if (typeof evalcx != 'function') {
evalcx("function f() { return this; }", cx); var cx = evalcx("");
var f = cx.f; evalcx("function f() { return this; }", cx);
assertEq(f(), cx); var f = cx.f;
assertEq(f(), cx);
}
reportCompare(0, 0, ""); reportCompare(0, 0, "");

View File

@ -4,6 +4,7 @@
* Contributor: Jason Orendorff * Contributor: Jason Orendorff
*/ */
assertEq(typeof evalcx, "function", "")
var cx = evalcx(""); var cx = evalcx("");
evalcx("function f() { return this; }", cx); evalcx("function f() { return this; }", cx);
f = cx.f; f = cx.f;