Package org.htmlunit.javascript.polyfill
Class Polyfill
- java.lang.Object
-
- org.htmlunit.javascript.polyfill.Polyfill
-
public class Polyfill extends java.lang.Object
Support to use polyfills for js features not implemented so far (idea from Colin Alworth).
-
-
Constructor Summary
Constructors Constructor Description Polyfill()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable scriptable)
Compile the script if needed and exec to setup the context.static Polyfill
getFetchPolyfill()
private static Polyfill
getPolyfill(java.lang.String resouceName)
-
-
-
Field Detail
-
CACHE
private static final java.util.Map<java.lang.String,Polyfill> CACHE
-
url_
private java.lang.String url_
-
source_
private java.lang.String source_
-
script_
private org.htmlunit.corejs.javascript.Script script_
-
-
Method Detail
-
getFetchPolyfill
public static Polyfill getFetchPolyfill() throws java.io.IOException
- Throws:
java.io.IOException
-
getPolyfill
private static Polyfill getPolyfill(java.lang.String resouceName) throws java.io.IOException
- Throws:
java.io.IOException
-
apply
public void apply(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable scriptable)
Compile the script if needed and exec to setup the context.- Parameters:
context
- the contextscriptable
- the scriptable
-
-