Backed out 2 changesets (bug 1021312, bug 1020460) for apparently causing jsreftest orange on a CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Fri, 06 Jun 2014 15:00:10 -0700
changeset 207649 6502442e61332740457eecde69db45aa0e9dc15b
parent 207648 5cf33b3e3d5e456df098d213056aff4754653579
child 207650 c0f0a8689dab95288f5fa5b5048363a99ce576f4
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1021312, 1020460
milestone32.0a1
backs outeca7bdeb0c6e333669cbbe585fbc3de979762aba
9655784430622fdd44aa40c835d517bdd1a24548
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 2 changesets (bug 1021312, bug 1020460) for apparently causing jsreftest orange on a CLOSED TREE Backed out changeset eca7bdeb0c6e (bug 1020460) Backed out changeset 965578443062 (bug 1021312)
js/src/jit-test/tests/basic/array-tosource.js
js/src/jit-test/tests/basic/testCrossCompartmentTransparency.js
js/src/jsarray.cpp
js/xpconnect/tests/unit/test_bug1021312.js
deleted file mode 100644
--- a/js/src/jit-test/tests/basic/array-tosource.js
+++ /dev/null
@@ -1,8 +0,0 @@
-load(libdir + 'asserts.js');
-
-assertEq(Array.prototype.toSource.call([1, 'hi']), '[1, "hi"]');
-assertEq(Array.prototype.toSource.call({1: 10, 0: 42, length: 2}), "[42, 10]");
-assertEq(Array.prototype.toSource.call({1: 10, 0: 42, length: 1}), "[42]");
-assertThrowsInstanceOf(() => Array.prototype.toSource.call("someString"), TypeError);
-assertThrowsInstanceOf(() => Array.prototype.toSource.call(42), TypeError);
-assertThrowsInstanceOf(() => Array.prototype.toSource.call(undefined), TypeError);
--- a/js/src/jit-test/tests/basic/testCrossCompartmentTransparency.js
+++ b/js/src/jit-test/tests/basic/testCrossCompartmentTransparency.js
@@ -51,16 +51,17 @@ function test(str, f) {
         f(proxy2);
     } catch (e) {
         assertEq(Object.prototype.toString.call(e), "[object Error]");
         threw = true;
     }
     assertEq(threw, true);
 }
 
+test("new Array(1,2,3)", function(a) Array.prototype.toSource.call(a));
 test("new Boolean(true)", function(b) Boolean.prototype.toSource.call(b));
 test("new Boolean(true)", function(b) Boolean.prototype.toString.call(b));
 test("new Boolean(true)", function(b) Boolean.prototype.valueOf.call(b));
 test("new Number(1)", function(n) Number.prototype.toSource.call(n));
 test("new Number(1)", function(n) Number.prototype.toString.call(n));
 test("new Number(1)", function(n) Number.prototype.valueOf.call(n));
 test("new Number(1)", function(n) Number.prototype.toFixed.call(n));
 test("new Number(1)", function(n) Number.prototype.toExponential.call(n));
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -845,27 +845,26 @@ AddLengthProperty(ExclusiveContext *cx, 
     JS_ASSERT(!obj->nativeLookup(cx, lengthId));
 
     return JSObject::addProperty(cx, obj, lengthId, array_length_getter, array_length_setter,
                                  SHAPE_INVALID_SLOT, JSPROP_PERMANENT | JSPROP_SHARED, 0,
                                  /* allowDictionary = */ false);
 }
 
 #if JS_HAS_TOSOURCE
-
-static bool
-array_toSource(JSContext *cx, unsigned argc, Value *vp)
+MOZ_ALWAYS_INLINE bool
+IsArray(HandleValue v)
 {
-    JS_CHECK_RECURSION(cx, return false);
-    CallArgs args = CallArgsFromVp(argc, vp);
-
-    if (!args.thisv().isObject()) {
-        ReportIncompatible(cx, args);
-        return false;
-    }
+    return v.isObject() && v.toObject().is<ArrayObject>();
+}
+
+MOZ_ALWAYS_INLINE bool
+array_toSource_impl(JSContext *cx, CallArgs args)
+{
+    JS_ASSERT(IsArray(args.thisv()));
 
     Rooted<JSObject*> obj(cx, &args.thisv().toObject());
     RootedValue elt(cx);
 
     AutoCycleDetector detector(cx, obj);
     if (!detector.init())
         return false;
 
@@ -921,16 +920,23 @@ array_toSource(JSContext *cx, unsigned a
     JSString *str = sb.finishString();
     if (!str)
         return false;
 
     args.rval().setString(str);
     return true;
 }
 
+static bool
+array_toSource(JSContext *cx, unsigned argc, Value *vp)
+{
+    JS_CHECK_RECURSION(cx, return false);
+    CallArgs args = CallArgsFromVp(argc, vp);
+    return CallNonGenericMethod<IsArray, array_toSource_impl>(cx, args);
+}
 #endif
 
 struct EmptySeparatorOp
 {
     bool operator()(JSContext *, StringBuffer &sb) { return true; }
 };
 
 struct CharSeparatorOp
--- a/js/xpconnect/tests/unit/test_bug1021312.js
+++ b/js/xpconnect/tests/unit/test_bug1021312.js
@@ -2,15 +2,15 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const Cu = Components.utils;
 function run_test() {
   let sb = new Cu.Sandbox(this);
   var called = false;
 
-  Cu.exportFunction(function(str) { do_check_true(/someString/.test(str)); called = true; },
+  Cu.exportFunction(function(str) { do_check_true(str, "someString"); called = true; },
                     sb, { defineAs: "func" });
   // Do something weird with the string to make sure that it doesn't get interned.
   Cu.evalInSandbox("var str = 'someString'; for (var i = 0; i < 10; ++i) str += i;", sb);
   Cu.evalInSandbox("func(str);", sb);
   do_check_true(called);
 }