Package org.ringojs.repository

Examples of org.ringojs.repository.Trackable


        if (args.length != 1) {
            throw Context.reportRuntimeError(
                    "addToClasspath() requires one argument");
        }
        try {
            Trackable path;
            RhinoEngine engine = ((RingoGlobal) funObj.getParentScope()).engine;
            Object arg = args[0] instanceof Wrapper ?
                    ((Wrapper) args[0]).unwrap() : args[0];
            if (arg instanceof String) {
                path = engine.resolve((String) arg,
                        engine.getParentRepository(thisObj));
            } else if (arg instanceof Trackable) {
                path = (Trackable) arg;
            } else {
                throw Context.reportRuntimeError(
                        "addToClasspath() requires a path argument");
            }

            if (!path.exists()) {
                throw Context.reportRuntimeError("addToClasspath(): Cannot find " + path);
            }

            engine.addToClasspath(path);
            return Boolean.TRUE;
View Full Code Here

TOP

Related Classes of org.ringojs.repository.Trackable

Copyright © 2018 www.massapicom. 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.