/should be tested more ... visit https://www.debuggex.com/
7748
function checkForSuffix(mmn, mmns, resultobj, suffix){
    var reponame, namespace, secondunderscorepos, group, lastindex;
    lastindex = mmns.lastIndexOf(suffix.group);
    if(lastindex<1 || lastindex!==mmns.length-suffix.group.length){
      return resultobj;
    }
    reponame = mmn.substring(suffix.username.length+1,mmn.length-suffix.group.length+1);
    namespace = null;
    if(reponame.charAt(0)==='_'){
      secondunderscorepos = (reponame.substring(1)).indexOf('_');
      if(secondunderscorepos>0){
        secondunderscorepos++; //because of reponame's substring(1)
        namespace = reponame.substring(1,secondunderscorepos);
        reponame = reponame.substring(secondunderscorepos+1);
        group = suffix.username+'_'+namespace+'_'+suffix.group;
      }
    }
    if(!group){
      group = suffix.username+'_'+suffix.group;
    }
    if (resultobj.matchlen >= suffix.group.length) {
      return resultobj;
    }

    switch (suffix.type) {
      case 'git':
        resultobj.matchlen = suffix.group.length;
        resultobj.result = {
          modulename: mmn,
          username: suffix.username,
          gitclonestring: descuserlib.gitclonestring(suffix, reponame),
          npmstring : descuserlib.gitsshnpmstring(suffix, reponame),
          group: suffix.group,
          reponame: reponame,
          namespace: namespace
        };
        return resultobj;
      case 'npm':
        resultobj.matchlen = suffix.group.length;
        resultobj.result = {
          modulename: mmn,
          username: suffix.username,
          npmstring : mmn,
          group: suffix.group,
          namespace: namespace
        };
        return resultobj;
    }
    return resultobj;
  }
742465
function assertStd (result, std) {
    var message = 'Expected value to match following regexp: ' + std + ', but got: ' + result;

    if (typeof std === 'string' || typeof std === 'number') {
      assert.equal(result && result.code || result, std);
    }
    else if (std instanceof RegExp) {
      assert.isNotNull(result.match(std), message);
    }
    else if (typeof std === 'function') {
      assert.ok(std(result));
    }
    else if (typeof result !== 'string' && result !== null) {
      assert.equal(result.code, 0);
    }
  }
1170528
func Debugf(format string, i ...interface{}) {
	if gLogLevel <= LDebug {
		logMessage("DEBUG - ", fmt.Sprintf(format, i...))
	}
}
91632
def debug(request, message, extra_tags='', fail_silently=False, async=False):
    """"""
    if ASYNC and async:
        messages.debug(_get_user(request), message)
    else:
        add_message(request, constants.DEBUG, message, extra_tags=extra_tags,
                    fail_silently=fail_silently)
1346623
function(url) {
		if (silentMode) {
			return;
		}

		console.log(
			colors.bold('\nTesting ' + link(url)) +
				' ... please wait, this may take a minute.'
		);
		if (program.timer) {
			console.time('Total test time');
		}
	}
1104583
private boolean isDebugOnFor(Frame frame)
    {
        if (_debugOn)
        {
            if (_debugPatterns==null)
                return true;
            else
            {
                for (int i = _debugPatterns.size();--i>=0;)
                {
                    if(frame.getWhere().indexOf((String)_debugPatterns
                                                .get(i))>=0)
                        return true;
                }
            }
        }
        return false;
    }
689882
function _debugActions($response, $mode, $order_time= '', $sessID = '') {
    global $db, $messageStack, $insert_id;
    if ($order_time == '') $order_time = date("F j, Y, g:i a");
    $response['url'] = $this->form_action_url;
    $this->reportable_submit_data['url'] = $this->form_action_url;

    $errorMessage = date('M-d-Y h:i:s') .
                    "\n=================================\n\n";
    if ($mode == 'Submit-Data') $errorMessage .=
                    'Sent to Authorizenet: ' . print_r($this->reportable_submit_data, true) . "\n\n";
    if ($mode == 'Response-Data') $errorMessage .=
                    'Response Code: ' . $response['x_response_code'] . ".\nResponse Text: " . $response['x_response_reason_text'] . "\n\n" .
                    ($response['x_response_code'] == 2 && $response['x_response_reason_code'] == 4 ? ' NOTICE: Card should be picked up - possibly stolen ' : '') .
                    ($response['x_response_code'] == 3 && $response['x_response_reason_code'] == 11 ? ' DUPLICATE TRANSACTION ATTEMPT ' : '') .
                    'Results Received back from Authorizenet: ' . print_r($response, true) . "\n\n";
    // store log file if log mode enabled
    if (stristr(MODULE_PAYMENT_AUTHORIZENET_DEBUGGING, 'Log') || strstr(MODULE_PAYMENT_AUTHORIZENET_DEBUGGING, 'All') || (defined('AUTHORIZENET_DEVELOPER_MODE') && in_array(AUTHORIZENET_DEVELOPER_MODE, array('on', 'certify')))) {
      $key = ($response['x_trans_id'] != '' ? $response['x_trans_id'] . '_' : '') . time() . '_' . zen_create_random_value(4);
      $file = $this->_logDir . '/' . 'SIM_Debug_' . $key . '.log';
      $fp = @fopen($file, 'a');
      @fwrite($fp, $errorMessage);
      @fclose($fp);
    }
    // send email alerts only if in alert mode or if email specifically requested as logging mode
    if ((isset($response['x_response_code']) && $response['x_response_code'] != '1' && stristr(MODULE_PAYMENT_AUTHORIZENET_DEBUGGING, 'Alerts')) || stristr(MODULE_PAYMENT_AUTHORIZENET_DEBUGGING, 'Email')) {
      zen_mail(STORE_NAME, STORE_OWNER_EMAIL_ADDRESS, 'Authorizenet-SIM Alert ' . $response['x_invoice_num'] . ' ' . date('M-d-Y h:i:s') . ' ' . $response['x_trans_id'], $errorMessage, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, array('EMAIL_MESSAGE_HTML'=>nl2br($errorMessage)), 'debug');
    }

    // DATABASE SECTION
    // Insert the send and receive response data into the database.
    // This can be used for testing or for implementation in other applications
    // This can be turned on and off if the Admin Section
    if (MODULE_PAYMENT_AUTHORIZENET_STORE_DATA == 'True' && $mode == 'Response-Data'){
      $db_response_text = $response['x_response_reason_text'];
      $db_response_text .= ($response['x_response_code'] == 2 && $response['x_response_reason_code'] == 4) ? ' NOTICE: Card should be picked up - possibly stolen ' : '';
      $db_response_text .= ($response['x_response_code'] == 3 && $response['x_response_reason_code'] == 11) ? ' DUPLICATE TRANSACTION ATTEMPT ' : '';

      // Insert the data into the database
      $sql = "insert into " . TABLE_AUTHORIZENET . "  (id, customer_id, order_id, response_code, response_text, authorization_type, transaction_id, sent, received, time, session_id) values (NULL, :custID, :orderID, :respCode, :respText, :authType, :transID, :sentData, :recvData, :orderTime, :sessID )";
      $sql = $db->bindVars($sql, ':custID', $_SESSION['customer_id'], 'integer');
      $sql = $db->bindVars($sql, ':orderID', preg_replace('/[^0-9]/', '', $insert_id), 'integer');
      $sql = $db->bindVars($sql, ':respCode', $response['x_response_code'], 'integer');
      $sql = $db->bindVars($sql, ':respText', $db_response_text, 'string');
      $sql = $db->bindVars($sql, ':authType', $response['x_type'], 'string');
      $sql = $db->bindVars($sql, ':transID', $response['x_trans_id'], 'string');
      $sql = $db->bindVars($sql, ':sentData', print_r($this->reportable_submit_data, true), 'string');
      $sql = $db->bindVars($sql, ':recvData', print_r($response, true), 'string');
      $sql = $db->bindVars($sql, ':orderTime', $order_time, 'string');
      $sql = $db->bindVars($sql, ':sessID', $sessID, 'string');
      $db->Execute($sql);
    }
  }
851083
public static function debug()
    {
        $vars = func_get_args();

        $cloner = new VarCloner();

        $dumper = 'cli' === PHP_SAPI ? new CliDumper() : new HtmlDumper();

        $dumper->setStyles([
            'default' => 'background-color:#fff; color:#FF8400; line-height:1.2em; 
                font:12px Menlo, Monaco, Consolas, monospace; word-wrap: break-word; 
                white-space: pre-wrap; position:relative; z-index:99999; word-break: normal',
            'num' => 'font-weight:bold; color:#1299DA',
            'const' => 'font-weight:bold',
            'str' => 'color:#111111',
            'note' => 'color:#1299DA',
            'ref' => 'color:#A0A0A0',
            'public' => 'color:blue',
            'protected' => 'color:#111',
            'private' => 'color:#478',
            'meta' => 'color:#B729D9',
            'key' => 'color:#212',
            'index' => 'color:#1200DA',
        ]);

        $handler = function ($vars) use ($cloner, $dumper) {
            if (!is_array($vars)) {
                $vars = [$vars];
            }

            foreach ($vars as $var) {
                $dumper->dump($cloner->cloneVar($var));
            }
        };

        call_user_func_array($handler, [$vars]);
    }
429606
function assert(actual, expected, message) {
  if (toString.call(expected) === '[object RegExp]' && expected.test(actual)) {
    return;
  } else if (eql(actual, expected)) {
    return;
  }

  var pad = Array(5).join(' ');
  var msg = message + '\n\n'
    + pad + 'Actual:   ' + inspect(actual) + '\n'
    + pad + 'Expected: ' + inspect(expected) + '\n';

  return new AssertionError(msg, {
    actual: actual,
    expected: expected,
    showDiff: assert.showDiff
  });
}
558278
function checkBug3(pmresult) {
	var fileContents, i, bundlesArray = pmresult.bundles.bundlesArray,
		STR_TO_SEARCH='\tconsole.log("BUG 3 - if this is printed more than once, then issue 3 is not solved");';
	fileContents = fs.readFileSync("../build/scripts/main/main-built.js", {encoding:"utf8"});
	if( fileContents.indexOf(STR_TO_SEARCH) < 0 ) return "not found in main-built.js";
	for( i=0; i < bundlesArray.length; i++ ) {
		if( bundlesArray[i].exclusive || bundlesArray[i].includedIn ) continue;
		fileContents = fs.readFileSync("../build/scripts/bundles/" + bundlesArray[i].id + ".js", {encoding:"utf8"});
		if( fileContents.indexOf(STR_TO_SEARCH) >= 0 ) return "found in bundle " + bundlesArray[i].id;
	}
	return false;
}
549141
function reportResult(test, indent) {
		assertTest(test);

		if (test.result.valid) {
			if (test.failOnMissing && test.result.missing && test.result.missing.length > 0) {
				reportFailed(test, indent);
			}
			else {
				reportSuccess(test);
			}
		}
		else {
			reportFailed(test, indent);
		}
		reportMissing(test, indent);
	}
1171051
func Debugf(format string, a ...interface{}) {
	if !debug {
		return
	}
	output("[DEBG]", fmt.Sprintf(format, a...))
}
1356243
function assertThrows(test) {
    var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Error;
    var contains = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];


    if (!Array.isArray(contains)) contains = [contains];

    var shouldErrorName = typeof error === 'string' ? error : error.name;

    var nonThrown = new Error('util.assertThrowsAsync(): Missing rejection' + (error ? ' with ' + error.name : ''));
    var ensureErrorMatches = function ensureErrorMatches(error) {
        // wrong type
        if (error.constructor.name != shouldErrorName) {
            return new Error('\n             util.assertThrowsAsync(): Wrong Error-type\n             - is    : ' + error.constructor.name + '\n             - should: ' + shouldErrorName + '\n             - error: ' + error.toString() + '\n             ');
        }
        // check if contains
        var errorString = error.toString();
        if (contains.length > 0 && (0, _utils.oneOfArrayNotInString)(contains, errorString)) {
            return new Error('\n               util.assertThrowsAsync(): Error does not contain\n               - should contain: ' + contains + '\n               - is string: ' + error.toString() + '\n             ');
        }
        return false;
    };

    return new Promise(function (res, rej) {
        var val = void 0;
        try {
            val = test();
        } catch (err) {
            var wrong = ensureErrorMatches(err);
            if (wrong) rej(wrong);else res(err);
            return;
        }
        if ((0, _isPromise2['default'])(val)) {
            val.then(function () {
                // has not thrown
                rej(nonThrown);
            })['catch'](function (err) {
                var wrong = ensureErrorMatches(err);
                if (wrong) rej(wrong);else res(err);
            });
        } else rej(nonThrown);
    });
}
820733
function checkFunction(node) {
            const scope = context.getScope();
            const regExpVar = astUtils.getVariableByName(scope, "RegExp");
            const shadowed = regExpVar && regExpVar.defs.length > 0;

            if (node.callee.type === "Identifier" && node.callee.name === "RegExp" && isString(node.arguments[0]) && !shadowed) {
                checkRegex(node, node.arguments[0].value, node.arguments[0].range[0] + 1);
            }
        }
104526
function (match) {
/*Line 29 - 'AtomEvaluator.js' */                var nv = "v" + (path.length + 1);
/*Line 30 - 'AtomEvaluator.js' */                if (match.indexOf("$owner.") == 0) {
/*Line 31 - 'AtomEvaluator.js' */                    match = match.substr(7);
/*Line 32 - 'AtomEvaluator.js' */                } else
/*Line 33 - 'AtomEvaluator.js' */                {
/*Line 34 - 'AtomEvaluator.js' */                    if (match.indexOf("owner.") == 0) {
/*Line 35 - 'AtomEvaluator.js' */                        match = match.substr(6);
/*Line 36 - 'AtomEvaluator.js' */                    } else {
/*Line 37 - 'AtomEvaluator.js' */                        match = match.substr(1);
/*Line 38 - 'AtomEvaluator.js' */                    }
/*Line 39 - 'AtomEvaluator.js' */                }
/*Line 40 - 'AtomEvaluator.js' */                path.push(match.split('.'));
/*Line 41 - 'AtomEvaluator.js' */                vars.push(nv);
/*Line 42 - 'AtomEvaluator.js' */                return nv;
/*Line 43 - 'AtomEvaluator.js' */            }
1216780
def debug(request, message, extra_tags='', fail_silently=False):
    """"""
    add_message(request, constants.DEBUG, message, extra_tags=extra_tags,
                fail_silently=fail_silently)
676747
function _buildRegexFromString(regex) {

        if (!regex || (typeof regex !== "string" && !(regex instanceof RegExp))) {
            _regexDebug();
            return false;
        }

        if (typeof regex !== 'string') {
            regex = regex.toString();
        }

        var separator = regex.charAt(0),
            index = regex.length - 1,
            pattern,
            modifier,
            rule;

        while (index > 0) {
            if (/[gimsxeU]/.test(regex.charAt(index))) {
                index--;
            } else {
                break;
            }
        }

        if (regex.charAt(index) !== separator) {
            separator = null;
        }

        if (separator && index !== regex.length - 1) {
            modifier = regex.substr(index + 1, regex.length - 1);
        }

        if (separator) {
            pattern = regex.substr(1, index - 1);
        } else {
            pattern = regex;
        }

        try {
            rule = new RegExp(pattern, modifier);
        } catch (error) {
            _regexDebug();
            return false;
        }

        return rule;

        function _regexDebug() {
            // {debug}
            window.Debug.log({
                'function': '_buildRegexFromString()',
                'arguments': '{pattern: {' + (pattern || '') + '}, modifier: {' + (modifier || '') + '}',
                'message': 'WARNING - Invalid regex given: ' + regex
            });
            window.Debug.print();
            // {/debug}
        }

    }