andruhon commented on a change in pull request #382: WICKET-6688 add RFC and 
replace eval with DOM eval
URL: https://github.com/apache/wicket/pull/382#discussion_r323985299
 
 

 ##########
 File path: 
wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
 ##########
 @@ -956,7 +975,7 @@
 
                                        try {
                                                // do the evaluation in global 
scope
-                                               var f = window.eval(toExecute);
+                                               var f = 
jQuery.globalEval(toExecute, {nonce: nonce});
 
 Review comment:
   @svenmeier speaking about returns we can simplify the code to something like 
this
   
   ```
   var toExecute = "(function(" + parameters + ") {" + body + "})()";
   
   try {
        // do the evaluation in global scope
        jQuery.globalEval(toExecute, {nonce: nonce});
   } catch (exception) {
        log.error("Wicket.Ajax.Call.processEvaluation: Exception evaluating 
javascript: %s", text, exception);
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to