Package org.mozilla.javascript

Examples of org.mozilla.javascript.Context.newObject()


        return newObject;
    }
   
    private JsSimpleDomNode newObject(Node node, JsSimpleDomNode prev) {
        Context cx = Context.enter();
        JsSimpleDomNode newObject = (JsSimpleDomNode)cx.newObject(getParentScope(), "Node");
        newObject.initialize(node, prev);
        return newObject;
    }

    private void establishChildren() {
View Full Code Here


                        }
                    }

                    int size = (params != null ? params.size() : 0);
                    Object[] funArgs = new Object[size];
                    Scriptable parameters = context.newObject(thrScope);
                    for (int i = 0; i < size; i++) {
                        Interpreter.Argument arg = (Interpreter.Argument)params.get(i);
                        funArgs[i] = arg.value;
                        if (arg.name == null) {
                            arg.name = "";
View Full Code Here

                FOM_JavaScriptFlowHelper.setFOM_FlowScope(cocoon.getObjectModel(), kScope);

                if (enableDebugger) {
                    getDebugger().setVisible(true);
                }
                Scriptable parameters = context.newObject(kScope);
                int size = params != null ? params.size() : 0;
                for (int i = 0; i < size; i++) {
                    Interpreter.Argument arg = (Interpreter.Argument)params.get(i);
                    parameters.put(arg.name, parameters, arg.value);
                }
View Full Code Here

        if (objectModel == null) {
            return _rootScope;
        } else {
            Context ctx = Context.enter();
            try {
                Scriptable scope = ctx.newObject(_rootScope);
                FOM_SimpleCocoon cocoon = (FOM_SimpleCocoon) ctx.newObject(scope, "FOM_SimpleCocoon", new Object[] { });
                cocoon.setObjectModel(objectModel);
                cocoon.setParentScope(scope);
                scope.put("cocoon", scope, cocoon);
                return scope;
View Full Code Here

            return _rootScope;
        } else {
            Context ctx = Context.enter();
            try {
                Scriptable scope = ctx.newObject(_rootScope);
                FOM_SimpleCocoon cocoon = (FOM_SimpleCocoon) ctx.newObject(scope, "FOM_SimpleCocoon", new Object[] { });
                cocoon.setObjectModel(objectModel);
                cocoon.setParentScope(scope);
                scope.put("cocoon", scope, cocoon);
                return scope;
            } catch (Exception e) {
View Full Code Here

            Scriptable parentScope = getParentScope(objectModel);

            // Create a new local scope
            Scriptable scope;
            try {
                scope = ctx.newObject(parentScope);
            } catch (Exception e) {
                // Should normally not happen
                throw new CascadingRuntimeException("Cannot create script scope", e);
            }
            scope.setParentScope(parentScope);
View Full Code Here

                // we always add the viewData even it is null (see bug COCOON-1916)
                final Object viewData = FlowHelper.getContextObject(objectModel);
                // Create a new local scope to hold the view data
                final Scriptable newScope;
                try {
                    newScope = ctx.newObject(scope);
                } catch (Exception e) {
                    // Should normally not happen
                    throw new CascadingRuntimeException("Cannot create function scope", e);
                }
                newScope.setParentScope(scope);
View Full Code Here

            // Put in the thread scope the Cocoon object, which gives access
            // to the interpreter object, and some Cocoon objects. See
            // FOM_Cocoon for more details.
            final Object[] args = {};
            FOM_Cocoon cocoon = (FOM_Cocoon) context.newObject(this,
                                                               "FOM_Cocoon",
                                                               args);
            cocoon.setParentScope(this);
            super.put("cocoon", this, cocoon);
View Full Code Here

        if (objectModel == null) {
            return _rootScope;
        } else {
            Context ctx = Context.enter();
            try {
                Scriptable scope = ctx.newObject(_rootScope);
                FOM_SimpleCocoon cocoon = (FOM_SimpleCocoon) ctx.newObject(scope, "FOM_SimpleCocoon", new Object[] { });
                cocoon.setObjectModel(objectModel);
                cocoon.setParentScope(scope);
                scope.put("cocoon", scope, cocoon);
                return scope;
View Full Code Here

            return _rootScope;
        } else {
            Context ctx = Context.enter();
            try {
                Scriptable scope = ctx.newObject(_rootScope);
                FOM_SimpleCocoon cocoon = (FOM_SimpleCocoon) ctx.newObject(scope, "FOM_SimpleCocoon", new Object[] { });
                cocoon.setObjectModel(objectModel);
                cocoon.setParentScope(scope);
                scope.put("cocoon", scope, cocoon);
                return scope;
            } catch (Exception e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.