func:  JSContext* const nsAString& const nsAString& const nsAString& uint32_t uint32_t uint32_t aFlags) if ( JSREPORT_IS_WARNING ( aFlags ) )  AutoTArray < RefPtr < SharedWorker > , 10 > sharedWorkers ; if ( sharedWorkers . IsEmpty ( ) )  AutoTArray < WindowAction , 10 > windowActions ; nsresult rv ; for (size_t index = 0; index < sharedWorkers.Length(); index++) RefPtr < SharedWorker > & sharedWorker = sharedWorkers [ index ] ; nsPIDOMWindowInner * window = sharedWorker -> GetOwner ( ) ; RootedDictionary < ErrorEventInit > errorInit ( aCx ) ; errorInit . mBubbles = false; errorInit . mCancelable = true; errorInit . mMessage = aMessage; errorInit . mFilename = aFilename; errorInit . mLineno = aLineNumber; errorInit . mColno = aColumnNumber; RefPtr < ErrorEvent > errorEvent = ErrorEvent :: Constructor ( sharedWorker , NS_LITERAL_STRING ( "error" ) , errorInit ) ; if ( ! errorEvent )  bool defaultActionEnabled ; nsresult rv = sharedWorker -> DispatchEvent ( errorEvent , & defaultActionEnabled ) ; if ( NS_FAILED ( rv ) )  if ( defaultActionEnabled )  size_t actionsIndex = windowActions . LastIndexOf ( WindowAction ( window ) ) ; if ( actionsIndex != windowActions . NoIndex )  windowActions [ actionsIndex ] . mDefaultAction = false; if ( windowActions . IsEmpty ( ) )  bool shouldLogErrorToConsole = true ; for (uint32_t index = 0; index < windowActions.Length(); index++) WindowAction & windowAction = windowActions [ index ] ; if ( ! windowAction . mWindow || ! windowAction . mDefaultAction )  nsCOMPtr < nsIScriptGlobalObject > sgo = do_QueryInterface ( windowAction . mWindow ) ; RootedDictionary < ErrorEventInit > init ( aCx ) ; init . mLineno = aLineNumber; init . mFilename = aFilename; init . mMessage = aMessage; init . mCancelable = true; init . mBubbles = true; nsEventStatus status = nsEventStatus_eIgnore ; rv = sgo -> HandleScriptError ( init , & status ); if ( NS_FAILED ( rv ) )  if ( status == nsEventStatus_eConsumeNoDefault )  shouldLogErrorToConsole = false; if ( shouldLogErrorToConsole )  LogErrorToConsole ( aMessage , aFilename , aLine , aLineNumber , aColumnNumber , aFlags , 0 );  LogErrorToConsole(const nsAString& const nsAString& const nsAString& uint32_t uint32_t uint32_t uint64_t aInnerWindowId) nsCOMPtr < nsIScriptError > scriptError = do_CreateInstance ( NS_SCRIPTERROR_CONTRACTID ) ; if ( scriptError )  if ( NS_FAILED ( scriptError -> InitWithWindowID ( aMessage , aFilename , aLine , aLineNumber , aColumnNumber , aFlags , "Web Worker" , aInnerWindowId ) ) )  scriptError = nullptr; nsCOMPtr < nsIConsoleService > consoleService = do_GetService ( NS_CONSOLESERVICE_CONTRACTID ) ; if ( consoleService )  if ( scriptError )  if ( NS_SUCCEEDED ( consoleService -> LogMessage ( scriptError ) ) )  if ( NS_SUCCEEDED ( consoleService -> LogStringMessage ( aMessage . BeginReading ( ) ) ) )  NS_ConvertUTF16toUTF8 msg ( aMessage ) ; NS_ConvertUTF16toUTF8 filename ( aFilename ) ; static const char kErrorString [ ] = "JS error in Web Worker: %s [%s:%u]" ; fprintf ( stderr , kErrorString , msg . get ( ) , filename . get ( ) , aLineNumber ); fflush ( stderr ); 