Scriptable newScope;
try {
newScope = ctx.newObject(scope);
} catch (Exception e) {
// Should normally not happen
throw new CascadingRuntimeException("Cannont create function scope", e);
}
newScope.setParentScope(scope);
scope = newScope;
scope.put("viewData", scope, Context.toObject(viewData, scope));