Require the core/compat/tapestry module before evaluating any JavaScript

Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/ce08b5a9
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/ce08b5a9
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/ce08b5a9

Branch: refs/heads/5.4-js-rewrite
Commit: ce08b5a90c50d96c87c175c1bf22c2d1c0967ecc
Parents: e2056f9
Author: Howard M. Lewis Ship <[email protected]>
Authored: Mon Aug 13 18:29:22 2012 -0700
Committer: Howard M. Lewis Ship <[email protected]>
Committed: Mon Aug 13 18:29:22 2012 -0700

----------------------------------------------------------------------
 .../META-INF/modules/core/pageinit.coffee          |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ce08b5a9/tapestry-core/src/main/coffeescript/META-INF/modules/core/pageinit.coffee
----------------------------------------------------------------------
diff --git 
a/tapestry-core/src/main/coffeescript/META-INF/modules/core/pageinit.coffee 
b/tapestry-core/src/main/coffeescript/META-INF/modules/core/pageinit.coffee
index 923fdbe..aee0589 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/core/pageinit.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/core/pageinit.coffee
@@ -140,8 +140,9 @@ define ["_", "core/console", "core/spi", "core/events"],
           spi.domReady -> exports.initialize otherInits
 
       evalJavaScript: (js) ->
-        console.debug "Evaluating: #{js}"
-        eval js
+        require ["core/compat/tapestry"], ->
+          console.debug "Evaluating: #{js}"
+          eval js
 
       # Passed the response from an Ajax request, when the request is 
successful.
       # This is used for any request that attaches partial-page-render data to 
the main JSON object

Reply via email to