Permalink
Browse files

Further fix Object.prototype.toString

  • Loading branch information...
1 parent ef68dd9 commit 6f8194743af20b2f5926b406f0918c7c7a391e82 @marijnh marijnh committed Oct 25, 2012
Showing with 4 additions and 1 deletion.
  1. +3 −0 jsos.lisp
  2. +1 −1 runtime.lisp
View
@@ -110,6 +110,9 @@
(defmethod obj-class-name ((obj (eql :null))) "Undefined")
(defmethod obj-class-name ((obj (eql t))) "Boolean")
(defmethod obj-class-name ((obj (eql nil))) "Boolean")
+(defmethod obj-class-name ((obj number)) "Number")
+(defmethod obj-class-name ((obj string)) "String")
+(defmethod obj-class-name ((obj t)) "Object")
;; Slots are (offset . flags) conses for scls objects, (value . flags) conses for hcls
(defconstant +slot-ro+ 1)
View
@@ -206,7 +206,7 @@
(.prototype :object
(:parent nil)
(:slot-default :nodel)
- (.func "toString" () (if (obj-p this) (format nil "[object ~a]" (obj-class-name this)) (to-string this)))
+ (.func "toString" () (format nil "[object ~a]" (obj-class-name this)))
(.func "toLocaleString" () (js-method this "toString"))
(.func "valueOf" () this)

0 comments on commit 6f81947

Please sign in to comment.