Fix several newly introduced bugs in the migration to mutable strings
[jscl.git] / jscl.html
index 1dfe7fc..0fde9fc 100644 (file)
--- a/jscl.html
+++ b/jscl.html
         jqconsole.RegisterMatching('(', ')', 'parents');
 
         lisp.write = function(str){
-           jqconsole.Write(str, 'jqconsole-output', false);
+           jqconsole.Write(xstring(str), 'jqconsole-output', false);
            return str;
         }
 
         var startPrompt = function () {
           // Start the prompt with history enabled.
-          jqconsole.Write(lisp.evalString(pv, 1, make_lisp_string('(CL:PACKAGE-NAME CL:*PACKAGE*)')) + '> ', 'jqconsole-prompt');
+          jqconsole.Write(xstring(lisp.evalString(pv, 1, make_lisp_string('(CL:PACKAGE-NAME CL:*PACKAGE*)'))) + '> ', 'jqconsole-prompt');
           jqconsole.Prompt(true, function (input) {
             // Output input with the class jqconsole-return.
             if (input[0] != ','){
                 try {
                     var vs = lisp.evalInput(mv, 1, make_lisp_string(input));
                     for (var i=0; i<vs.length; i++){
-                       jqconsole.Write(lisp.print(pv, 1, vs[i]) + '\n', 'jqconsole-return');
+                       jqconsole.Write(xstring(lisp.print(pv, 1, vs[i])) + '\n', 'jqconsole-return');
                     }
                 } catch(error) {
                     jqconsole.Write('ERROR: ' + (error.message || error) + '\n', 'jqconsole-error');
                 }
             } else {
-                jqconsole.Write(lisp.compileString(pv, 1, make_lisp_string(input.slice(1))) + '\n', 'jqconsole-return');
+                jqconsole.Write(xstring(lisp.compileString(pv, 1, make_lisp_string(input.slice(1)))) + '\n', 'jqconsole-return');
             }
             // Restart the prompt.
             startPrompt();