From 9ba3011d1bb6deaf4635b87df7d1f8540e72fe55 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Wed, 6 Feb 2013 10:50:27 -0500 Subject: [PATCH] Bug 838567 - URL.createObjectURL(new Object()); in Workers crashes debug builds reliably. r=bent --- dom/workers/URL.cpp | 4 +++- dom/workers/test/url_worker.js | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dom/workers/URL.cpp b/dom/workers/URL.cpp index ecb3011213f2..d2fa929c016b 100644 --- a/dom/workers/URL.cpp +++ b/dom/workers/URL.cpp @@ -204,7 +204,9 @@ URL::CreateObjectURL(const WorkerGlobalObject& aGlobal, JSObject* aBlob, nsCOMPtr blob = file::GetDOMBlobFromJSObject(aBlob); if (!blob) { SetDOMStringToNull(aResult); - aRv.Throw(NS_ERROR_TYPE_ERR); + + NS_NAMED_LITERAL_STRING(blobStr, "Blob"); + aRv.ThrowTypeError(MSG_DOES_NOT_IMPLEMENT_INTERFACE, &blobStr); return; } diff --git a/dom/workers/test/url_worker.js b/dom/workers/test/url_worker.js index c5aabd209a0f..0c7c2d8b930d 100644 --- a/dom/workers/test/url_worker.js +++ b/dom/workers/test/url_worker.js @@ -59,5 +59,14 @@ onmessage = function() { postMessage({type: 'status', status: status, msg: 'Blob URL2:' + url}); postMessage({type: 'url', url: url}); + status = false; + try { + URL.createObjectURL(new Object()); + } catch(e) { + status = true; + } + + postMessage({type: 'status', status: status, msg: 'Exception wanted' }); + postMessage({type: 'finish' }); }