summaryrefslogtreecommitdiff
path: root/module/language/ecmascript/compile-ghil.scm
diff options
context:
space:
mode:
Diffstat (limited to 'module/language/ecmascript/compile-ghil.scm')
-rw-r--r--module/language/ecmascript/compile-ghil.scm11
1 files changed, 11 insertions, 0 deletions
diff --git a/module/language/ecmascript/compile-ghil.scm b/module/language/ecmascript/compile-ghil.scm
index 1b90f48c5..880c79e35 100644
--- a/module/language/ecmascript/compile-ghil.scm
+++ b/module/language/ecmascript/compile-ghil.scm
@@ -101,6 +101,17 @@
(make-ghil-inline e l 'return (list (comp expr e))))
((array . ,args)
(@impl e l new-array (map (lambda (x) (comp x e)) args)))
+ ((object . ,args)
+ (@impl e l new-object
+ (map (lambda (x)
+ (pmatch x
+ ((,prop ,val)
+ (make-ghil-inline e l 'cons
+ (list (make-ghil-quote e l prop)
+ (comp val e))))
+ (else
+ (error "bad prop-val pair" x))))
+ args)))
((pref ,obj ,prop)
(@impl e l pget (list (comp obj e) (make-ghil-quote e l prop))))
((= (ref ,name) ,val)