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:
parent
785fb107ef
commit
a287987818
2 changed files with 158 additions and 7 deletions
|
@ -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")))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue