{ hunk ./javascript/sw/sw-ajax.js 59 - [_$_] + + $.swRun = function(code_id, async, json, func) + { + try + { + if (async) + func(); + else + $.swReturnValue(code_id, json, func); + } + catch(exception) + { + $.swReturnFail(code_id, exception); + } + } + + hunk ./src/ajax.lisp 41 - (post-parameter "exception-str"))))) + (sw-decode-json (post-parameter "exception-str")))))) hunk ./src/code.lisp 24 -(defun js-ack (code-id code json) - (if *async* - code - (concatenate 'string " -$.swReturnValue(\"" code-id "\"," (if json "true" "false") ", function(){ -" code " -});"))) - - -(defun js-fail (code-id) - "This can only be executed in a context where the variable `exception' exist." - (concatenate 'string " -$.swReturnFail(\"" code-id "\", exception);")) - - hunk ./src/code.lisp 45 - (run-js (concatenate 'string " -try{ -" (js-ack (code-id-of code) (code-of code) json) " -} catch(exception){ -" (js-fail (code-id-of code)) " -}")) + (run-js (concatenate 'string "$.swRun(\"" (code-id-of code) "\"," + (if *async* "1" "0") "," + (if json "1" "0") + ",function(){" (code-of code) "})")) }