Class NativeFunctionToStringFunction

  • All Implemented Interfaces:
    java.io.Serializable, org.htmlunit.corejs.javascript.Callable, org.htmlunit.corejs.javascript.Constructable, org.htmlunit.corejs.javascript.Function, org.htmlunit.corejs.javascript.Scriptable

    public class NativeFunctionToStringFunction
    extends FunctionWrapper
    Replacement (in fact a wrapper) for Rhino's native toString function on Function prototype allowing to produce the desired formatting.
    See Also:
    Serialized Form
    • Constructor Detail

      • NativeFunctionToStringFunction

        NativeFunctionToStringFunction​(org.htmlunit.corejs.javascript.Function wrapped)
    • Method Detail

      • installFix

        public static void installFix​(org.htmlunit.corejs.javascript.Scriptable window,
                                      BrowserVersion browserVersion)
        Install the wrapper in place of the native toString function on Function's prototype.
        Parameters:
        window - the scope
        browserVersion - the simulated browser
      • call

        public java.lang.Object call​(org.htmlunit.corejs.javascript.Context cx,
                                     org.htmlunit.corejs.javascript.Scriptable scope,
                                     org.htmlunit.corejs.javascript.Scriptable thisObj,
                                     java.lang.Object[] args)
        Specified by:
        call in interface org.htmlunit.corejs.javascript.Callable
        Specified by:
        call in interface org.htmlunit.corejs.javascript.Function
        Overrides:
        call in class FunctionWrapper