In order to get browsers to launch without error we need to pass specific flags to some of them
354684
function(browser, data) {
        // Some browsers are platform specific so exit out if not available
        if(data[browser][process.platform]) {
            if(browser.indexOf("firefox") !== -1) {
                // Handles firefox, firefox aurora and firefox nightly
                cleanLaunchFirefox(browser, data);
            } else if(browser.indexOf("chrome") !== -1) {
                // Handles chrome and chrome canary
                cleanLaunchChrome(browser, data);
            } else if(browser.indexOf("opera") !== -1) {
                // Handles opera and opera next
                cleanLaunchOpera(browser, data);
            } else if(browser.indexOf("phantomjs") !== -1) {
                // Handles opera and opera next
                cleanLaunchPhantomjs(browser, data);
            }  else {
                // Safari don't require special treatment
                data[browser].process = exec(data[browser][process.platform] + " " + url);
            }
        }
    }
868889
def restrict_flags(declarer, *flags)
      copy = restrict(declarer)
      copy.qualify(*flags)
      copy
    end
231865
function( e ) {
      // Reset error windows from all elements
      this.reset( FIELDS );
      // Start control each elements
      this.checkFields( e );
      if( e.type !== 'submit' ) return; // if event type is not submit, break
      // This is for when running remote request, return false and wait request response
      else if ( this.handler === 'pending' ) return false;
      // if event type is submit and handler is true, break submit and call onError() function
      else if( this.handler === true ) { this.options.onError.call( this, e ); return false; }
      else return this.options.onValid.call( this, e ); // if form is valid call onValid() function
    }
674679
function helperMissing() {
  const args = [].slice.call(arguments);
  const options = args.pop();
  throw new Error(`cannot resolve permalink variable: ":${options.name}"`);
}
759471
function(ctx, flag) {
		var node = ctx.node,
			tree = ctx.tree,
			opts = ctx.options;
		// flag defaults to true
		flag = (flag !== false);

		node.debug("nodeSetSelected(" + flag + ")", ctx);
		if( node.unselectable){
			return;
		}
		// TODO: !!node.expanded is nicer, but doesn't pass jshint
		// https://github.com/jshint/jshint/issues/455
//        if( !!node.expanded === !!flag){
		if((node.selected && flag) || (!node.selected && !flag)){
			return !!node.selected;
		}else if ( this._triggerNodeEvent("beforeSelect", node, ctx.originalEvent) === false ){
			return !!node.selected;
		}
		if(flag && opts.selectMode === 1){
			// single selection mode
			if(tree.lastSelectedNode){
				tree.lastSelectedNode.setSelected(false);
			}
		}else if(opts.selectMode === 3){
			// multi.hier selection mode
			node.selected = flag;
//			this._fixSelectionState(node);
			node.fixSelection3AfterClick();
		}
		node.selected = flag;
		this.nodeRenderStatus(ctx);
		tree.lastSelectedNode = flag ? node : null;
		tree._triggerNodeEvent("select", ctx);
	}
896705
function enableAnomalyMail(flag) {
	emailOn = flag
	if (!isEmailOn()) { // notify if off state
		var printableState = typeof flag === 'number' ?
			'disabled until: ' + (new Date(flag)).toISOString().substring(0, 10) :
			'disabled'
		var callersLocation = haraldutil.getLocation({offset: 1, folder: false, object: false, fileLine: true, dropExt: true})
		log(id, printableState, callersLocation)
	}
	return emailOn
}
1045821
function ignoreErrorForStatusCodes() {
  var statusCodes = Array.prototype.slice.call(arguments);

  return function(ctx, next) {
    if (ctx.err && ctx.res && statusCodes.indexOf(ctx.res.statusCode) !== -1) {
      delete ctx.err;
    }

    next();
  };
}
413711
function onError(error) {
    if (error.syscall !== 'listen') throw error;

    const bind = (typeof port === 'string')
                ? 'Pipe ' + port
                : 'Port ' + port;

    // handle specific listen errors with friendly messages
    switch (error.code) {
      case 'EACCES':
        console.error(bind + ' requires elevated privileges');
        process.exit(1);
        break;

      case 'EADDRINUSE':
        console.error(bind + ' is already in use');
        process.exit(1);
        break;

      default:
        throw error;
    }
  }
1069497
protected void ensureNoFlags(final String flags) {
        if (flags == null || flags.isEmpty()) return;
        throw FormatException.formatFlagsMismatch(flags, getFormatName());
    }
1129570
def browser(browser_name='xdg-open'):

    """"""

    if not browser_name:
        return None
    argv = shlex.split(browser_name)
    executable = find_executable(argv[0])
    if executable is None:
        # Why not raise an exception? -I think it is more convenient (for
        # end users) to have a reasonable default, without enforcing it.
        logging.getLogger(__name__).warn(
            _("Can't find file browser: {0!r}. "
              "You may want to change the value for the '-f' option.",
              browser_name))
        return None

    def browse(path):
        return subprocess.Popen(argv + [path])

    return browse
313914
static void checkHeapFlags(final int flags) {  //only used by checkPreLongsFlagsCap and test
    final int allowedFlags =
        READ_ONLY_FLAG_MASK | EMPTY_FLAG_MASK | COMPACT_FLAG_MASK | ORDERED_FLAG_MASK;
    final int flagsMask = ~allowedFlags;
    if ((flags & flagsMask) > 0) {
      throw new SketchesArgumentException(
         "Possible corruption: Invalid flags field: " + Integer.toBinaryString(flags));
    }
  }
1128742
function(launchConfiguration, checkStatus) {
			var errorHandler = function (error) {
				// stop the progress spinner in the launch config dropdown trigger
				this.setStatus({
					error: error || true //if no error was passed in we still want to ensure that the error state is recorded
				});
			}.bind(this);
			
			if (launchConfiguration) {
				this._selectedLaunchConfiguration = launchConfiguration;
				this._setLaunchConfigurationsLabel(launchConfiguration);
				
				if (checkStatus) {
					this._displayStatusCheck(launchConfiguration);
					var startTime = Date.now();
					this._checkLaunchConfigurationStatus(launchConfiguration).then(function(_status) {
						var interval = Date.now() - startTime;
						mMetrics.logTiming("deployment", "check status (launch config)", interval, launchConfiguration.Type); //$NON-NLS-1$ //$NON-NLS-2$

						launchConfiguration.status = _status;
						this._updateLaunchConfiguration(launchConfiguration);
					}.bind(this), errorHandler);
				} else {
					// do not check the status, only set it in the UI if it is already in the launchConfiguration
					if (launchConfiguration.status) {
						this.setStatus(launchConfiguration.status);
					}
				}
			} else {
				this._stopStatusPolling(); //stop before clearing selected config
				this._selectedLaunchConfiguration = null;
				this._setLaunchConfigurationsLabel(null);
				this.setStatus({});
			}
			this._menuItemsCache = [];
		}
1030293
function(browser) {
      return runner.runJsUnitTests(options.filter, browser).then(
          function(results) {
            var failedCount = results.reduce(function(prev, item) {
              return prev + (item['pass'] ? 0 : 1);
            }, 0);
            log(results.length + ' tests, ' + failedCount + ' failure(s).');
            log('[ ' + chalk.cyan(browser) + ' ] JSUnit tests: ',
                failedCount > 0 ? chalk.red('FAILED') : chalk.green('PASSED'));
            if (failedCount > 0) {
              throw new Error();
            }
          }, finalize);
    }
1368170
function(msg) {

		if (typeof(window) == 'undefined') throw new Error(msg); // Node environment

		if (window.console) {
			window.console.error(msg);
		}

	}
212979
def _init_browser(self):
        
        chrome_options = webdriver.ChromeOptions()
        chrome_options.add_argument('--disable-extensions')
        chrome_options.add_argument('--disable-infobars')
        chrome_options.add_argument('--ignore-certificate-errors')
        chrome_options.add_experimental_option('prefs', {
            'profile.managed_default_content_settings.notifications': 1
        })

        browser = webdriver.Chrome(chrome_options=chrome_options)
        browser.set_page_load_timeout(10)
        browser.implicitly_wait(1)
        browser.maximize_window()
        browser.get(settings.HARNESS_URL)
        self._browser = browser
        if not wait_until(lambda: 'Thread' in browser.title, 30):
            self.assertIn('Thread', browser.title)
614291
function createFlags( flags ) {
	var object = flagsCache[ flags ] = {},
		i, length;
	flags = flags.split( /\s+/ );
	for ( i = 0, length = flags.length; i < length; i++ ) {
		object[ flags[i] ] = true;
	}
	return object;
}
329417
function openExplorerinWindows(path, callback) {
    path = path || '=';
    let p = spawn('explorer', [path]);
    p.on('error', (err) => {
        p.kill();
        return callback(err);
    });
}