Package org.mozilla.javascript

Examples of org.mozilla.javascript.ScriptableObject.associateValue()


            if (log.isDebugEnabled()) {
                log.debug("Compiling code from {}", fileName);
            }

            ScriptableObject ret = (ScriptableObject)cx.newObject(thisObj);
            ret.associateValue(FILE_NAME_KEY, fileName);

            Script compiled = getCompiledScript(cx, code, fileName);
            if (compiled == null) {
                // Compilation failed, probably because the script is too large
                ret.associateValue(SOURCE_KEY, code);
View Full Code Here


            ret.associateValue(FILE_NAME_KEY, fileName);

            Script compiled = getCompiledScript(cx, code, fileName);
            if (compiled == null) {
                // Compilation failed, probably because the script is too large
                ret.associateValue(SOURCE_KEY, code);
            } else {
                ret.associateValue(CODE_KEY, compiled);
            }
            return ret;
        }
View Full Code Here

            Script compiled = getCompiledScript(cx, code, fileName);
            if (compiled == null) {
                // Compilation failed, probably because the script is too large
                ret.associateValue(SOURCE_KEY, code);
            } else {
                ret.associateValue(CODE_KEY, compiled);
            }
            return ret;
        }

        /**
 
View Full Code Here

                Err errs = new Err();
                self.transFactory.setErrorListener(errs);
                Templates tmpl = self.transFactory.newTemplates(src);

                ScriptableObject ret = (ScriptableObject)cx.newObject(thisObj);
                ret.associateValue("template", tmpl);
                return ret;

            } catch (TransformerConfigurationException e) {
                throw Utils.makeError(cx, thisObj, "XSLT transformer exception: " + e);
            }
View Full Code Here

            ensureArg(args, 0);
            XmlWrapImpl self = (XmlWrapImpl)thisObj;

            Source src = self.getSource(cx, args[0]);
            ScriptableObject ret = (ScriptableObject)cx.newObject(thisObj);
            ret.associateValue("document", src);
            return ret;
        }

        @JSFunction
        @SuppressWarnings("unused")
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.