[HtmlUnit] SVN: [13834] trunk/htmlunit/src

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[HtmlUnit] SVN: [13834] trunk/htmlunit/src

asashour-2
Revision: 13834
          http://sourceforge.net/p/htmlunit/code/13834
Author:   asashour
Date:     2017-03-20 07:11:58 +0000 (Mon, 20 Mar 2017)
Log Message:
-----------
scriptEngine_ to be null is not needed

Modified Paths:
--------------
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/DomElement.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngineTest.java

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java 2017-03-19 22:02:22 UTC (rev 13833)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java 2017-03-20 07:11:58 UTC (rev 13834)
@@ -498,8 +498,7 @@
         WebAssert.notNull("webResponse", webResponse);
         WebAssert.notNull("webWindow", webWindow);
 
-        if (webResponse.getStatusCode() == HttpStatus.SC_NO_CONTENT
-                || scriptEngine_ == null) {
+        if (webResponse.getStatusCode() == HttpStatus.SC_NO_CONTENT) {
             return webWindow.getEnclosedPage();
         }
 
@@ -1837,7 +1836,6 @@
         // start a new window that will start the thread again
         if (scriptEngine_ != null) {
             scriptEngine_.shutdown();
-            scriptEngine_ = null;
         }
 
         try {

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/DomElement.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/DomElement.java 2017-03-19 22:02:22 UTC (rev 13833)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/html/DomElement.java 2017-03-20 07:11:58 UTC (rev 13834)
@@ -1390,11 +1390,7 @@
             }
         };
 
-        final JavaScriptEngine engine = client.getJavaScriptEngine();
-        if (engine == null) {
-            return null;
-        }
-        final ContextFactory cf = engine.getContextFactory();
+        final ContextFactory cf = client.getJavaScriptEngine().getContextFactory();
         final ScriptResult result = (ScriptResult) cf.call(action);
         if (event.isAborted(result)) {
             preventDefault();

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngineTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngineTest.java 2017-03-19 22:02:22 UTC (rev 13833)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngineTest.java 2017-03-20 07:11:58 UTC (rev 13834)
@@ -1468,7 +1468,7 @@
     }
 
     /**
-     * Tests case where {@link JavaScriptEngine#registerWindowAndMaybeStartEventLoop(WebWindow)}
+     * Test case where {@link JavaScriptEngine#registerWindowAndMaybeStartEventLoop(WebWindow)}
      * is being called after {@link JavaScriptEngine#shutdown()}.
      */
     @Test


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop