Examples of evaluateString()


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

            compileScope.setParentScope(coffeeScript);
            compileScope.put("coffeeScript", compileScope, coffeeScriptSource);
            try {
                boolean useMap = map != SourceMap.NONE;
                String options = String.format("{bare: %s, sourceMap: %s, literate: %s, header: %s, filename: '%s'}", bare, useMap, literate, header, sourceName);
                Object result = context.evaluateString(
                        compileScope,
                        String.format("compile(coffeeScript, %s);", options),
                        sourceName, 0, null);

                if (map == SourceMap.NONE) {
View Full Code Here

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

           
            for(String name : objectsToPutInScope.keySet()) {
                compileScope.put( name, compileScope, objectsToPutInScope.get( name ));
            }
           
            return (String)context.evaluateString(
                    compileScope,
                    scriptString,
                    sourceName, 0, null);
           
        } finally {
View Full Code Here

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

    final Context context = Context.enter();
    try {
      final ScriptableObject scope = (ScriptableObject) context
          .initStandardObjects(this.moduleScope);

      final Object result = context.evaluateString(scope,
          String.format(this.source, data), this.name, 1, null);

      output.append(String.valueOf(result));
    } catch (final JavaScriptException e) {
      throw new SmallerException("Failed to run javascript", e);
View Full Code Here

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

      final ContextFactory contextFactory = new ContextFactory();
      final Context context = contextFactory.enterContext();
      final Scriptable scope = context.initStandardObjects();
      wrapper = initializeScope(scope);

      final Object o = context.evaluateString(scope, expression, getName(), 1, null);
      if (o instanceof NativeJavaObject)
      {
        final NativeJavaObject object = (NativeJavaObject) o;
        return object.unwrap();
      }
View Full Code Here

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

      Object result = null;
     
      for (String resource : javascriptResources) {
        try {
          result = cx.evaluateString(scope,
          FileUtils.readWholeFileAsUTF8(this.getClass().getResourceAsStream(resource)).replaceAll("org", "xorg"),
          resource,
          1,
          (Object)null);
        } catch (NullPointerException e) {
View Full Code Here

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

          System.out.println("Failed to load " + resource);
        }
      }
     
      result =
        cx.evaluateString(
          scope,
          "parseTtlToWalker('" + ttlString.replaceAll("org", "xorg") + "','file:///localhost/RhinoTest.java');",
          "file:///ttlString",
          1,
          (Object)null);
View Full Code Here

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

          "file:///ttlString",
          1,
          (Object)null);

      result =
        cx.evaluateString(
          scope,
          testString.replaceAll("org", "xorg"),
          "file:///testString",
          1,
          (Object)null);
View Full Code Here

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

      Object result = null;
     
      for (String resource : javascriptResources) {
        try {
          result = cx.evaluateString(scope,
          FileUtils.readWholeFileAsUTF8(this.getClass().getResourceAsStream(resource)).replaceAll("org", "xorg"),
          resource,
          1,
          (Object)null);
        } catch (NullPointerException e) {
View Full Code Here

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

          System.out.println("Failed to load " + resource);
        }
      }
     
      result =
        cx.evaluateString(
          scope,
          "parseTtlToWalker('" + ttlString.replaceAll("org", "xorg") + "','file:///localhost/RhinoTest.java');",
          "file:///ttlString",
          1,
          (Object)null);
View Full Code Here

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

          "file:///ttlString",
          1,
          (Object)null);

      result =
        cx.evaluateString(
          scope,
          testString.replaceAll("org", "xorg"),
          "file:///testString",
          1,
          (Object)null);
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.