Class NativeFunctionToStringFunction

java.lang.Object
org.htmlunit.javascript.FunctionWrapper
org.htmlunit.javascript.NativeFunctionToStringFunction
All Implemented Interfaces:
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:
  • Constructor Details

    • NativeFunctionToStringFunction

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

    • 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 Object call(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.Scriptable scope, org.htmlunit.corejs.javascript.Scriptable thisObj, 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