Module org.htmlunit

Class Polyfill

java.lang.Object
org.htmlunit.javascript.polyfill.Polyfill

public class Polyfill extends Object
Support to use polyfills for js features not implemented so far (idea from Colin Alworth).
Author:
Ronald Brill
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    apply(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.VarScope scope, org.htmlunit.corejs.javascript.Scriptable thisObject)
    Compile the script if needed and exec to setup the context.
    static Polyfill
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Polyfill

      public Polyfill()
  • Method Details

    • getFetchPolyfill

      public static Polyfill getFetchPolyfill() throws IOException
      Returns:
      the build in fetch polyfill
      Throws:
      IOException - in case of error
    • apply

      public void apply(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.VarScope scope, org.htmlunit.corejs.javascript.Scriptable thisObject)
      Compile the script if needed and exec to setup the context.
      Parameters:
      context - the context
      scope - the scope to execute relative to
      thisObject - the value "this" should be set to