Skip to content

Conversation

@cdalexndr
Copy link
Contributor

Fix the following javascript error:
new URL('http://test.com/path?a=b).searchParams.set('a',b')

com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function set in object a=b.
	at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:949)
	at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:598)
	at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:487)
	at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.callSecured(HtmlUnitContextFactory.java:353)
	at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:829)
	at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:805)
	at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:796)
	at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.<init>(ScriptableObject.java:390)
	at com.gargoylesoftware.htmlunit.javascript.HtmlUnitScriptable.<init>(HtmlUnitScriptable.java:35)
	at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.<init>(SimpleScriptable.java:52)
	at com.gargoylesoftware.htmlunit.javascript.host.URLSearchParams.<init>(URLSearchParams.java:123)
	at com.gargoylesoftware.htmlunit.javascript.host.URL.getSearchParams(URL.java:227)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)

@rbri rbri merged commit 63c4096 into HtmlUnit:master Aug 31, 2021
@rbri
Copy link
Member

rbri commented Aug 31, 2021

As always many thanks fr the contribution. Will have a look at the others during the next days.

Btw: it will be really great if we can use your real name for the author tag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants