Bug 688646 - Followup fix to make recent test changes feature-test for shell-only functionality. r=orange
authorJeff Walden <jwalden@mit.edu>
Mon, 26 Sep 2011 18:28:57 -0700
changeset 77650 6d691de3932bf3d3a6b1a244ab7cb17aa8e226f7
parent 77649 db9f10c18560f582e2e5b064362e6ff950f8906b
child 77651 e2f5052798cc825f726ac083ed438724a5ef57b5
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersorange
bugs688646
milestone9.0a1
Bug 688646 - Followup fix to make recent test changes feature-test for shell-only functionality. r=orange
js/src/tests/ecma_3/Function/15.3.4.4-1.js
--- a/js/src/tests/ecma_3/Function/15.3.4.4-1.js
+++ b/js/src/tests/ecma_3/Function/15.3.4.4-1.js
@@ -147,25 +147,27 @@ addThis();
  * Function.prototype.call() and
  * Function.prototype.call(null) should return the same result
  */
 status = inSection(10);
 actual = F2.call(null);
 expect = F2.call();
 addThis();
 
-/*
- * Function.prototype.call gets lexical globals, not caller globals
- */
-status = inSection(11);
-actual = g2 = newGlobal('new-compartment');
-g2.eval("boundMethod = Function('return this');");
-expect = g2.boundMethod.call();
-addThis();
-
+if (typeof newGlobal === "function")
+{
+  /*
+   * Function.prototype.call gets lexical globals, not caller globals
+   */
+  status = inSection(11);
+  actual = g2 = newGlobal('new-compartment');
+  g2.eval("boundMethod = Function('return this');");
+  expect = g2.boundMethod.call();
+  addThis();
+}
 
 
 //-----------------------------------------------------------------------------
 test();
 //-----------------------------------------------------------------------------