summaryrefslogtreecommitdiff
path: root/module/language/ecmascript/parse.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-02-22 10:51:49 +0100
committerAndy Wingo <wingo@pobox.com>2009-02-22 10:51:49 +0100
commit8c306808c25fb1f353dca2b1d6a1356193e72dea (patch)
tree0f4fc4f94a64627245232d768566ece9691ead36 /module/language/ecmascript/parse.scm
parentaec8febc4621e87d9c3c1a10341ead00f784ff7f (diff)
downloadguile-8c306808c25fb1f353dca2b1d6a1356193e72dea.tar.gz
+ for strings, global js object, new Foo() works
* module/language/ecmascript/array.scm (*array-prototype*): Declare the constructor. * module/language/ecmascript/base.scm (pput, pdel): Remove some needless checks. (new): Move definition of new here, and use the constructor. * module/language/ecmascript/compile-ghil.scm (compile-ghil): Add a stub so that when we load a compiled JS program, we make sure the runtime has been booted. * module/language/ecmascript/function.scm (js-constructor): Export a js-constructor method instead of a new method. * module/language/ecmascript/impl.scm (<js-global-object>): Define a new class for the global "this" object, wrapping bindings from the current module. (init-js-bindings!): Define the dozen or so global properties, in the current module. (+): Define addition operations for non-numbers. This is efficient because the generics are only dispatched if the fast-path fails.
Diffstat (limited to 'module/language/ecmascript/parse.scm')
-rw-r--r--module/language/ecmascript/parse.scm2
1 files changed, 1 insertions, 1 deletions
diff --git a/module/language/ecmascript/parse.scm b/module/language/ecmascript/parse.scm
index 4603f6235..86b7176fc 100644
--- a/module/language/ecmascript/parse.scm
+++ b/module/language/ecmascript/parse.scm
@@ -212,7 +212,7 @@
(new MemberExpression Arguments) -> `(new ,$2 ,$3))
(NewExpression (MemberExpression) -> $1
- (new NewExpression) -> `(new ,$2))
+ (new NewExpression) -> `(new ,$2 ()))
(CallExpression (MemberExpression Arguments) -> `(call ,$1 ,$2)
(CallExpression Arguments) -> `(call ,$1 ,$2)