Bug 981984 - OwningStringOrUnsignedLong union value cannot be set if the type is not matched. r=bz
authorGene Lian <clian@mozilla.com>
Wed, 30 Apr 2014 17:52:05 +0800
changeset 181623 d811c553a16540a5dd7dd9c6194c6ffa90dd2e26
parent 181622 9a6b434b34bec675539d12ce7566bc76f01ceaf1
child 181624 5e72eab5fab74ada669b4a43a4ddbd2ad9dd9a71
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersbz
bugs981984
milestone32.0a1
Bug 981984 - OwningStringOrUnsignedLong union value cannot be set if the type is not matched. r=bz
dom/workers/DataStore.cpp
--- a/dom/workers/DataStore.cpp
+++ b/dom/workers/DataStore.cpp
@@ -746,28 +746,17 @@ public:
 
     nsRefPtr<WorkerDataStore> workerStore =
       mDataStoreChangeEventProxy->GetWorkerStore();
 
     DataStoreChangeEventInit eventInit;
     eventInit.mBubbles = false;
     eventInit.mCancelable = false;
     eventInit.mRevisionId = mRevisionId;
-
-    // TODO Bug 981984: OwningStringOrUnsignedLong union value cannot be set if
-    // the type is not matched.
-    //
-    // This is a work-around to clean up the OwningStringOrUnsignedLong value
-    // initialized by DataStoreChangeEventInit, which will always set |mId| to
-    // a UnsignedLong type by default (see DataStoreChangeEvent.webidl). This
-    // will fail the later assignment when the type of value we want to assign
-    // is actually String.
-    // eventInit.mId.~OwningStringOrUnsignedLong();
     eventInit.mId = mId;
-
     eventInit.mOperation = mOperation;
     eventInit.mOwner = mOwner;
 
     nsRefPtr<DataStoreChangeEvent> event =
       DataStoreChangeEvent::Constructor(workerStore,
                                         NS_LITERAL_STRING("change"),
                                         eventInit);