Quantcast

[HtmlUnit] SVN: [14147] trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/ javascript/host/Element2.java

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

[HtmlUnit] SVN: [14147] trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/ javascript/host/Element2.java

asashour-2
Revision: 14147
          http://sourceforge.net/p/htmlunit/code/14147
Author:   asashour
Date:     2017-04-21 10:53:21 +0000 (Fri, 21 Apr 2017)
Log Message:
-----------
hu3: fix event handlers

Modified Paths:
--------------
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Element2.java

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Element2.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Element2.java 2017-04-21 10:31:27 UTC (rev 14146)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Element2.java 2017-04-21 10:53:21 UTC (rev 14147)
@@ -146,8 +146,9 @@
                 Context.setGlobal(global);
             }
             thisObject.addBoundProperties(global);
-            final ScriptFunction eventHandler = context.compileScript(source, thisObject);
-            ScriptRuntime.apply(eventHandler, thisObject);
+            final ScriptFunction script = context.compileScript(source, thisObject);
+            ScriptRuntime.apply(script, thisObject);
+            final ScriptFunction eventHandler = (ScriptFunction) thisObject.get(eventName);
             setEventHandler(eventName, eventHandler);
         }
         finally {


------------------------------------------------------------------------------
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
Loading...