1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-14 15:40:19 +02:00

implement ++, --, new, delete, void, typeof

* module/language/ecmascript/compile-ghil.scm (@impl): Implement with
  @implv.
  (comp): Implement ++ and -- (pre- and post-). Quite a pain. I'll be
  looking for ways to simplify this notation. Also implement new, delete,
  and void.

* module/language/ecmascript/impl.scm: Implement typeof.
This commit is contained in:
Andy Wingo 2009-02-20 16:15:50 +01:00
parent 785fb107ef
commit a287987818
2 changed files with 158 additions and 7 deletions

View file

@ -24,7 +24,7 @@
#:use-module (language ecmascript base)
#:use-module (language ecmascript function)
#:use-module (language ecmascript array)
#:export (get-this)
#:export (get-this typeof)
#:re-export (*undefined* *this* call/this*
pget pput pdel
new-object
@ -33,3 +33,13 @@
(define (get-this)
(fluid-ref *this*))
(define (typeof x)
(cond ((eq? x *undefined*) "undefined")
((null? x) "object")
((boolean? x) "boolean")
((number? x) "number")
((string? x) "string")
((procedure? x) "function")
((is-a? x <js-object>) "object")
(else "scm")))