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.scm16
1 files changed, 16 insertions, 0 deletions
diff --git a/module/language/ecmascript/compile-ghil.scm b/module/language/ecmascript/compile-ghil.scm
index 825599d05..2f385643f 100644
--- a/module/language/ecmascript/compile-ghil.scm
+++ b/module/language/ecmascript/compile-ghil.scm
@@ -62,6 +62,8 @@
(make-ghil-quote e l num))
((string ,str)
(make-ghil-quote e l str))
+ (this
+ (@impl e l get-this '()))
((+ ,a ,b)
(make-ghil-inline e l 'add (list (comp a e) (comp b e))))
((- ,a ,b)
@@ -95,6 +97,20 @@
(lambda (env vars)
(make-ghil-lambda env l vars #t '()
(comp-body env l body formals '%args)))))
+ ((call/this ,obj ,prop ,args)
+ (@impl e l call/this*
+ (list obj (make-ghil-lambda
+ e l '() #f '()
+ (make-ghil-call e l (@impl e l pget (list obj prop))
+ args)))))
+ ((call (pref ,obj ,prop) ,args)
+ (comp `(call/this ,(comp obj e) ,(make-ghil-quote e l prop)
+ ,(map (lambda (x) (comp x e)) args))
+ e))
+ ((call (aref ,obj ,prop) ,args)
+ (comp `(call/this ,(comp obj e) ,(comp prop e)
+ ,(map (lambda (x) (comp x e)) args))
+ e))
((call ,proc ,args)
(make-ghil-call e l (comp proc e) (map (lambda (x) (comp x e)) args)))
((return ,expr)