/** * {@inheritDoc} */ @Override public Object compileRegExp(final Context cx, final String source, final String flags) { try { return wrapped_.compileRegExp(cx, source, flags); } catch (final Exception e) { LOG.warn("compileRegExp() threw for >" + source + "<, flags: >" + flags + "<. " + "Replacing with a '####shouldNotFindAnything###'"); return wrapped_.compileRegExp(cx, "####shouldNotFindAnything###", ""); } }
/** * {@inheritDoc} */ @Override public int find_split(final Context cx, final Scriptable scope, final String target, final String separator, final Scriptable re, final int[] ip, final int[] matchlen, final boolean[] matched, final String[][] parensp) { return wrapped_.find_split(cx, scope, target, separator, re, ip, matchlen, matched, parensp); }
/** * {@inheritDoc} */ @Override public boolean isRegExp(final Scriptable obj) { return wrapped_.isRegExp(obj); }
/** * Use the wrapped proxy except for replacement with string arg where it uses Java regular expression. * {@inheritDoc} */ @Override public Object action(final Context cx, final Scriptable scope, final Scriptable thisObj, final Object[] args, final int actionType) { try { return doAction(cx, scope, thisObj, args, actionType); } catch (final StackOverflowError e) { // TODO: We shouldn't have to catch this exception and fall back to Rhino's regex support! // See HtmlUnitRegExpProxyTest.stackOverflow() LOG.warn(e.getMessage(), e); return wrapped_.action(cx, scope, thisObj, args, actionType); } }
/** * {@inheritDoc} */ @Override public Scriptable wrapRegExp(final Context cx, final Scriptable scope, final Object compiled) { return wrapped_.wrapRegExp(cx, scope, compiled); }
/** * Use the wrapped proxy except for replacement with string arg where it uses Java regular expression. * {@inheritDoc} */ @Override public Object action(final Context cx, final Scriptable scope, final Scriptable thisObj, final Object[] args, final int actionType) { try { return doAction(cx, scope, thisObj, args, actionType); } catch (final StackOverflowError e) { // TODO: We shouldn't have to catch this exception and fall back to Rhino's regex support! // See HtmlUnitRegExpProxyTest.stackOverflow() LOG.warn(e.getMessage(), e); return wrapped_.action(cx, scope, thisObj, args, actionType); } }
/** * {@inheritDoc} */ @Override public Scriptable wrapRegExp(final Context cx, final Scriptable scope, final Object compiled) { return wrapped_.wrapRegExp(cx, scope, compiled); }
/** * Use the wrapped proxy except for replacement with string arg where it uses Java regular expression. * {@inheritDoc} */ @Override public Object action(final Context cx, final Scriptable scope, final Scriptable thisObj, final Object[] args, final int actionType) { try { return doAction(cx, scope, thisObj, args, actionType); } catch (final StackOverflowError e) { // TODO: We shouldn't have to catch this exception and fall back to Rhino's regex support! // See HtmlUnitRegExpProxyTest.stackOverflow() LOG.warn(e.getMessage(), e); return wrapped_.action(cx, scope, thisObj, args, actionType); } }
/** * {@inheritDoc} */ @Override public Scriptable wrapRegExp(final Context cx, final Scriptable scope, final Object compiled) { return wrapped_.wrapRegExp(cx, scope, compiled); }
/** * {@inheritDoc} */ @Override public int find_split(final Context cx, final Scriptable scope, final String target, final String separator, final Scriptable re, final int[] ip, final int[] matchlen, final boolean[] matched, final String[][] parensp) { return wrapped_.find_split(cx, scope, target, separator, re, ip, matchlen, matched, parensp); }
/** * {@inheritDoc} */ @Override public boolean isRegExp(final Scriptable obj) { return wrapped_.isRegExp(obj); }
/** * {@inheritDoc} */ @Override public Object compileRegExp(final Context cx, final String source, final String flags) { try { return wrapped_.compileRegExp(cx, source, flags); } catch (final Exception e) { LOG.warn("compileRegExp() threw for >" + source + "<, flags: >" + flags + "<. " + "Replacing with a '####shouldNotFindAnything###'"); return wrapped_.compileRegExp(cx, "####shouldNotFindAnything###", ""); } }
/** * Use the wrapped proxy except for replacement with string arg where it uses Java regular expression. * {@inheritDoc} */ @Override public Object action(final Context cx, final Scriptable scope, final Scriptable thisObj, final Object[] args, final int actionType) { try { return doAction(cx, scope, thisObj, args, actionType); } catch (final StackOverflowError e) { // TODO: We shouldn't have to catch this exception and fall back to Rhino's regex support! // See HtmlUnitRegExpProxyTest.stackOverflow() LOG.warn(e.getMessage(), e); return wrapped_.action(cx, scope, thisObj, args, actionType); } }
/** * {@inheritDoc} */ @Override public Scriptable wrapRegExp(final Context cx, final Scriptable scope, final Object compiled) { return wrapped_.wrapRegExp(cx, scope, compiled); }
/** * {@inheritDoc} */ @Override public int find_split(final Context cx, final Scriptable scope, final String target, final String separator, final Scriptable re, final int[] ip, final int[] matchlen, final boolean[] matched, final String[][] parensp) { return wrapped_.find_split(cx, scope, target, separator, re, ip, matchlen, matched, parensp); }
/** * {@inheritDoc} */ @Override public boolean isRegExp(final Scriptable obj) { return wrapped_.isRegExp(obj); }
/** * {@inheritDoc} */ @Override public Object compileRegExp(final Context cx, final String source, final String flags) { try { return wrapped_.compileRegExp(cx, source, flags); } catch (final Exception e) { LOG.warn("compileRegExp() threw for >" + source + "<, flags: >" + flags + "<. " + "Replacing with a '####shouldNotFindAnything###'"); return wrapped_.compileRegExp(cx, "####shouldNotFindAnything###", ""); } }
/** * Calls action on the wrapped RegExp proxy. */ private Object wrappedAction(final Context cx, final Scriptable scope, final Scriptable thisObj, final Object[] args, final int actionType) { // take care to set the context's RegExp proxy to the original one as this is checked // (cf net.sourceforge.htmlunit.corejs.javascript.regexp.RegExpImp:334) try { ScriptRuntime.setRegExpProxy(cx, wrapped_); return wrapped_.action(cx, scope, thisObj, args, actionType); } finally { ScriptRuntime.setRegExpProxy(cx, this); } }
/** * {@inheritDoc} */ @Override public Scriptable wrapRegExp(final Context cx, final Scriptable scope, final Object compiled) { return wrapped_.wrapRegExp(cx, scope, compiled); }