[bugfix method-call problem Henrik Hjelte **20061115234144] { hunk ./src/js.lisp 678 - (when (typep (m-object form) 'js-lambda) + (when (member (m-object form) (list 'js-lambda 'number-literal 'js-object 'op-form) :test #'typep) hunk ./src/js.lisp 687 - (last (car (last fname)))) - (nconc butlast - (dwim-join (mapcar #'(lambda (x) (js-to-strings x (+ start-pos 2))) - (m-args form)) - (- 80 start-pos 2) - :start last - :end ")" - :join-after ","))))) + (last (car (last fname))) + (method-and-args (dwim-join (mapcar #'(lambda (x) (js-to-strings x (+ start-pos 2))) + (m-args form)) + (- 80 start-pos 2) + :start last + :end ")" + :join-after ",")) + (ensure-no-newline-before-dot (concatenate 'string + (car (last butlast)) + (first method-and-args)))) + (nconc (butlast butlast) + (list ensure-no-newline-before-dot) + (rest method-and-args))))) hunk ./t/test.lisp 74 - (.match (+ "" x) "foo") - "('' + x).match('foo')") + (.match (+ "" x) "foo") + "('' + x).match('foo')") hunk ./t/test.lisp 77 +(test-ps-js method-call-op-form (.to-string (+ "" x)) "('' + x).toString()") hunk ./t/test.lisp 85 - } }).toString();") + } }).toString()") hunk ./t/test.lisp 89 - "x.toString();") + "x.toString()") hunk ./t/test.lisp 93 - "[10, 20].toString();") + "[10, 20].toString()") hunk ./t/test.lisp 96 - "foo().toString();") + "foo().toString()") hunk ./t/test.lisp 99 - "(function () {alert(10);}).toString();") + "(function () {alert(10);}).toString()") hunk ./t/test.lisp 102 - "(function (x) {return x;})(10).toString();") - + "(function (x) {return x;})(10).toString()") +(test no-whitespace-before-dot + (let* ((str (js:js* '(.to-string ((lambda (x) (return x)) 10)))) + (dot-pos (position #\. str :test #'char=)) + (char-before (elt str (1- dot-pos))) + (a-parenthesis #\))) + (is (char= char-before a-parenthesis)))) }