:collect nil)))
(defprinter js-slot-value (obj slot)
- (append-to-last (if (eql 'js-variable (car obj))
+ (append-to-last (if (and (listp obj) (eql 'js-variable (car obj)))
(ps-print obj %start-pos%)
(list (format nil "~A" (ps-print obj %start-pos%))))
- (if (eql 'script-quote (car slot))
+ (if (and (listp slot) (eql 'script-quote (car slot)))
(format nil ".~A" (if (symbolp (second slot))
(js-translate-symbol (second slot))
(first (ps-print slot 0))))
(test-ps-js obj-literal-strings
(create "foo" 2)
- "{ 'foo' : 2 }")
\ No newline at end of file
+ "{ 'foo' : 2 }")
+
+(test-ps-js slot-value-string
+ (slot-value foo "bar")
+ "foo['bar']")