Skip to content

Commit

Permalink
scope is not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed Aug 4, 2024
1 parent ddd9b83 commit 24ca458
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/main/java/org/htmlunit/javascript/JavaScriptEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ public Script compile(final HtmlPage owningPage, final Scriptable scope, final S
LOG.trace("Javascript compile " + sourceName + newline + sourceCode + newline);
}

final HtmlUnitContextAction action = new HtmlUnitContextAction(scope, owningPage) {
final HtmlUnitContextAction action = new HtmlUnitContextAction(owningPage) {
@Override
public Object doRun(final Context cx) {
return cx.compileString(sourceCode, sourceName, startLine, null);
Expand Down Expand Up @@ -803,7 +803,7 @@ public Object execute(final HtmlPage page, final Scriptable scope, final Script
return null;
}

final HtmlUnitContextAction action = new HtmlUnitContextAction(scope, page) {
final HtmlUnitContextAction action = new HtmlUnitContextAction(page) {
@Override
public Object doRun(final Context cx) {
return script.exec(cx, scope);
Expand Down Expand Up @@ -864,7 +864,7 @@ public Object callFunction(final HtmlPage page, final Function function,
return null;
}

final HtmlUnitContextAction action = new HtmlUnitContextAction(scope, page) {
final HtmlUnitContextAction action = new HtmlUnitContextAction(page) {
@Override
public Object doRun(final Context cx) {
if (ScriptRuntime.hasTopCall(cx)) {
Expand Down Expand Up @@ -903,11 +903,9 @@ public boolean isScriptRunning() {
* "guarantees proper association of Context instances with the current thread and is faster".
*/
private abstract class HtmlUnitContextAction implements ContextAction<Object> {
private final Scriptable scope_;
private final HtmlPage page_;

HtmlUnitContextAction(final Scriptable scope, final HtmlPage page) {
scope_ = scope;
HtmlUnitContextAction(final HtmlPage page) {
page_ = page;
}

Expand Down

0 comments on commit 24ca458

Please sign in to comment.