Examples of newObject()


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

        if (node == null) {
            return null;
        }
       
        Context cx = Context.enter();
        JsSimpleDomNode newObject = (JsSimpleDomNode)cx.newObject(scope, "Node");
        newObject.initialize(node, null);
        return newObject;
    }
   
    private JsSimpleDomNode newObject(Node node, JsSimpleDomNode prev) {
View Full Code Here

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

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

        Context cx = Context.enter();
        try {

            Object xml = cx.getWrapFactory().wrap(cx, scope, xmlObject, XmlObject.class);
            Scriptable jsXML = cx.newObject(scope, "XML", new Object[] { xml });

            return jsXML;

        } finally {
            Context.exit();
View Full Code Here

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

     */
    protected void initSharedScope() {
        Context cx = Context.enter();
        try {

            this.sharedScope = cx.newObject(scriptScope);
            sharedScope.setPrototype(scriptScope);
            sharedScope.setParentScope(null);

        } finally {
            Context.exit();
View Full Code Here

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

                throw new Error(e.getMessage());
            }

            // Define some global variables in JavaScript
            Object args[] = {};
            Scriptable log = context.newObject(scope, "Log", args);
            ((JSLog)log).enableLogging(getLogger());
            scope.put("log", scope, log);
            errorReporter = new JSErrorReporter(getLogger());
        }
        catch (Exception e) {
View Full Code Here

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

        long lastExecTime = 0;
        if (thrScope == null) {

            newScope = true;

            thrScope = context.newObject(scope);

            thrScope.setPrototype(scope);
            // We want 'thrScope' to be a new top-level scope, so set its
            // parent scope to null. This means that any variables created
            // by assignments will be properties of "thrScope".
View Full Code Here

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

            // Put in the thread scope the Cocoon object, which gives access
            // to the interpreter object, and some Cocoon objects. See
            // JSCocoon for more details.
            Object args[] = {};
            cocoon = (JSCocoon)context.newObject(thrScope, "Cocoon", args);
            cocoon.setInterpreter(this);
            cocoon.setParentScope(thrScope);
            thrScope.put("cocoon", thrScope, cocoon);
            ((ScriptableObject)thrScope).defineProperty(LAST_EXEC_TIME,
                                                        new Long(0),
View Full Code Here

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

  @Override
  public String compile (String coffeeScriptSource) {
        Context context = Context.enter();
        try {
            Scriptable compileScope = context.newObject(globalScope);
            compileScope.setParentScope(globalScope);
            compileScope.put("coffeeScriptSource", compileScope, coffeeScriptSource);
            try {
                return (String)context.evaluateString(compileScope, String.format("CoffeeScript.compile(coffeeScriptSource, %s);", options.toJavaScript()),
                        "JCoffeeScriptCompiler", 0, null);
View Full Code Here

Examples of org.qi4j.api.object.ObjectFactory.newObject()

    }

    private void testInjection( SingletonAssembler assembly )
    {
        ObjectFactory factory = assembly.module();
        ServiceUser user = factory.newObject( ServiceUser.class );

        assertEquals( "X", user.testSingle() );
        assertEquals( "Foo", user.testIdentity() );
        assertEquals( "XX", user.testIterable() );
        assertEquals( "FooX", user.testServiceReference() );
View Full Code Here

Examples of org.qi4j.api.structure.Module.newObject()

                    module.objects( Stuff.class );
                }

            };
            Module module = assembler.module();
            Stuff stuff = module.newObject( Stuff.class );
            // END SNIPPET: singleton
        }

    }
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.