function makeCheckHook(checkAsync, checkImport) {
	if (!checkAsync && !checkImport) return null;
	return (hook, args) => {
		if (hook === 'function' || hook === 'generator_function' || hook === 'eval' || hook === 'run' ||
			(!checkAsync && (hook === 'async_function' || hook === 'async_generator_function'))) {
			if (hook === 'eval') {
				const script = args[0];
				args = [script];
				if (typeof(script) !== 'string') return args;
			} else {
				// Next line throws on Symbol, this is the same behavior as function constructor calls
				args = args.map(arg => `${arg}`);
			}
			const hasAsync = checkAsync && args.findIndex(arg => /\basync\b/.test(arg)) !== -1;
			const hasImport = checkImport && args.findIndex(arg => /\bimport\b/.test(arg)) !== -1;
			if (!hasAsync && !hasImport) return args;
			const mapped = args.map(arg => {
				if (hasAsync) arg = arg.replace(/async/g, 'a\\u0073ync');
				if (hasImport) arg = arg.replace(/import/g, 'i\\u006dport');
				return arg;
			});
			try {
				tryCompile(mapped);
			} catch (u) {
				// Some random syntax error or error because of async or import.

				// First report real syntax errors
				tryCompile(args);

				if (hasAsync && hasImport) {
					const mapped2 = args.map(arg => arg.replace(/async/g, 'a\\u0073ync'));
					try {
						tryCompile(mapped2);
					} catch (e) {
						throw new VMError('Async not available');
					}
					throw new VMError('Dynamic Import not supported');
				}
				if (hasAsync) {
					// Then async error
					throw new VMError('Async not available');
				}
				throw new VMError('Dynamic Import not supported');
			}
			return args;
		}
		if (checkAsync) throw new VMError('Async not available');
		return args;
	};
}
The software receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.