From 80c1a7a5b8f5ba7975fc7b4cecf1717961b482ce Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Wed, 2 Apr 2014 10:09:29 +0100 Subject: [PATCH] Bug 989665 - Console API should clone objects propertly. Crash fixed, r=bz --- dom/base/Console.cpp | 2 +- dom/base/test/mochitest.ini | 1 + dom/base/test/test_bug989665.html | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 dom/base/test/test_bug989665.html diff --git a/dom/base/Console.cpp b/dom/base/Console.cpp index ad7852b5d828..2502851026e8 100644 --- a/dom/base/Console.cpp +++ b/dom/base/Console.cpp @@ -74,7 +74,7 @@ ConsoleStructuredCloneCallbacksRead(JSContext* aCx, } nsTArray* strings = static_cast*>(aClosure); - MOZ_ASSERT(strings->Length() <= aData); + MOZ_ASSERT(strings->Length() > aData); JS::Rooted value(aCx); if (!xpc::StringToJsval(aCx, strings->ElementAt(aData), &value)) { diff --git a/dom/base/test/mochitest.ini b/dom/base/test/mochitest.ini index 2cbcb8f9b660..3c9f320d646f 100644 --- a/dom/base/test/mochitest.ini +++ b/dom/base/test/mochitest.ini @@ -14,6 +14,7 @@ support-files = [test_bug913761.html] [test_bug978522.html] [test_bug979109.html] +[test_bug989665.html] [test_clearTimeoutIntervalNoArg.html] [test_consoleEmptyStack.html] [test_constructor-assignment.html] diff --git a/dom/base/test/test_bug989665.html b/dom/base/test/test_bug989665.html new file mode 100644 index 000000000000..298274d7ae61 --- /dev/null +++ b/dom/base/test/test_bug989665.html @@ -0,0 +1,21 @@ + + + + + + Test for Bug 989665 + + + + +Mozilla Bug 989665 + + +