capybara/session.py
def evaluate_script(self, script, *args):
        """
        Evaluate the given JavaScript and return the result. Be careful when using this with
        scripts that return complex objects, such as jQuery statements. :meth:`execute_script`
        might be a better alternative.

        Args:
            script (str): A string of JavaScript to evaluate.
            *args: Variable length argument list to pass to the executed JavaScript string.

        Returns:
            object: The result of the evaluated JavaScript (may be driver specific).
        """

        args = [arg.base if isinstance(arg, Base) else arg for arg in args]
        result = self.driver.evaluate_script(script, *args)
        return self._wrap_element_script_result(result)
def evaluate_script(self, script, *args):
        """
        Evaluate the given JavaScript and return the result. Be careful when using this with
        scripts that return complex objects, such as jQuery statements. :meth:`execute_script`
        might be a better alternative.

        Args:
            script (str): A string of JavaScript to evaluate.
            *args: Variable length argument list to pass to the executed JavaScript string.

        Returns:
            object: The result of the evaluated JavaScript (may be driver specific).
        """

        args = [arg.base if isinstance(arg, Base) else arg for arg in args]
        result = self.driver.evaluate_script(script, *args)
        return self._wrap_element_script_result(result)
Evaluate the given JavaScript and return the result. Be careful when using this with
        scripts that return complex objects, such as jQuery statements. :meth:`execute_script`
        might be a better alternative.

        Args:
            script (str): A string of JavaScript to evaluate.
            *args: Variable length argument list to pass to the executed JavaScript string.

        Returns:
            object: The result of the evaluated JavaScript (may be driver specific).