Use DOMError::CreateForNSResult() to create DOMError from nsresult. Fix bug in RemoveExtraParentReferences().