Author: Stephan <[email protected]>
Branch:
Changeset: r251:6a59def531f7
Date: 2012-06-05 18:31 +0200
http://bitbucket.org/pypy/lang-js/changeset/6a59def531f7/
Log: some fixes for completion
diff --git a/js/builtins_global.py b/js/builtins_global.py
--- a/js/builtins_global.py
+++ b/js/builtins_global.py
@@ -249,9 +249,11 @@
x = get_arg(args, 0)
if not isinstance(x, W_String):
- return x
+ from js.completion import NormalCompletion
+ return NormalCompletion(value = x)
src = x.to_string()
+
try:
ast = parse_to_ast(src)
except ParseError, e:
@@ -272,6 +274,7 @@
f = JsEvalCode(code)
calling_context = ctx._calling_context_
+
ctx = EvalExecutionContext(f, calling_context = calling_context)
res = f.run(ctx)
return res
diff --git a/js/jsobj.py b/js/jsobj.py
--- a/js/jsobj.py
+++ b/js/jsobj.py
@@ -870,6 +870,8 @@
def Call(self, args = [], this = None, calling_context = None):
from js.execution_context import FunctionExecutionContext
+ from js.completion import Completion
+
code = self.code()
argn = self.formal_parameters()
strict = self._strict_
@@ -885,6 +887,8 @@
ctx._calling_context_ = calling_context
res = code.run(ctx)
+
+ assert isinstance(res, Completion)
return res.value
# 15.3.5.4
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit