Examples of defineProperty()


Examples of org.mozilla.javascript.NativeObject.defineProperty()

        value = Boolean.TRUE;
    } else {
        name = option.substring(0, valueDelimiter);
        value = option.substring(valueDelimiter+1);
    }
    nativeOptions.defineProperty(name, value, NativeObject.READONLY);
      }
  }
  return nativeOptions;
    }
View Full Code Here

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

    protected void postRenderView() throws Exception {
        ScriptableObject scriptableObject =
                (ScriptableObject) this.page.executeJavaScript("window.LOG").getJavaScriptResult();

        scriptableObject.defineProperty("out", systemOut, ScriptableObject.READONLY);
    }

    protected HtmlPage renderView(String viewId) throws Exception {
        buildView(viewId);
        preRenderView();
View Full Code Here

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

        public XLoper execute(IFunctionContext context, XLoper[] args) throws RequestException {
            Context ctx = Context.enter();
            Object[] oargs = converter.convert(args, BSFScript.createArgHints(args));
            ScriptableObject so = ctx.initStandardObjects();
            Scriptable argsObj = ctx.newArray(so, oargs);
            so.defineProperty("args", argsObj, ScriptableObject.DONTENUM);
            try {
                return converter.createFrom(script.exec(ctx, so));
            } catch (Throwable t) {
                throw new RequestException(t.getMessage());
            }
View Full Code Here

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

      logger.debug ("abandon called with: " + args[0]);
        }
        throw new AbandonedException ((String)args[0]);
    }
      };
  wfe.defineProperty ("abandon", fo, ScriptableObject.PERMANENT);
        wfe.defineProperty
            ("activityUniqueKey", Context.javaToJS(activity.uniqueKey(), scope),
             ScriptableObject.PERMANENT | ScriptableObject.READONLY);
  scope.put("scriptingContext", scope, wfe);
       
View Full Code Here

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

        }
        throw new AbandonedException ((String)args[0]);
    }
      };
  wfe.defineProperty ("abandon", fo, ScriptableObject.PERMANENT);
        wfe.defineProperty
            ("activityUniqueKey", Context.javaToJS(activity.uniqueKey(), scope),
             ScriptableObject.PERMANENT | ScriptableObject.READONLY);
  scope.put("scriptingContext", scope, wfe);
       
  prepareArguments(cx, scope, formPars, map);
View Full Code Here

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

              return "Arguments";
          }
            };
        for (int i = 0; i < formPars.length; i++) {
            String fp = formPars[i].id();
            args.defineProperty
          (fp,
                 convertArgument(cx, scope, formPars[i].type(), map.get(fp)),
           formPars[i].mode() == FormalParameter.Mode.IN
           ? ScriptableObject.PERMANENT | ScriptableObject.READONLY
           : ScriptableObject.PERMANENT);
View Full Code Here

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

      throws Exception {
    List<String> output = Lists.newArrayList();
    Context context = new ContextFactory().enterContext();
    context.setOptimizationLevel(-1)// Only running once.
    ScriptableObject globalScope = context.initStandardObjects();
    globalScope.defineProperty(
        "navigator", Context.javaToJS(new Navigator(), globalScope), ScriptableObject.DONTENUM);

    Reader soyutils = new InputStreamReader(new FileInputStream(soyUtilsPath), Charsets.UTF_8);
    try {
      String basename = soyUtilsPath.substring(soyUtilsPath.lastIndexOf('/') + 1);
View Full Code Here

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

      context.evaluateReader(globalScope, soyutils, basename, 1, null);
    } finally {
      soyutils.close();
    }

    globalScope.defineProperty(
        "test_toEscape", ImmutableList.copyOf(toEscape), ScriptableObject.DONTENUM);
    globalScope.defineProperty("test_output", output, ScriptableObject.DONTENUM);

    context.evaluateString(
        globalScope,
View Full Code Here

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

      soyutils.close();
    }

    globalScope.defineProperty(
        "test_toEscape", ImmutableList.copyOf(toEscape), ScriptableObject.DONTENUM);
    globalScope.defineProperty("test_output", output, ScriptableObject.DONTENUM);

    context.evaluateString(
        globalScope,
        Joiner.on('\n').join(
            "(function () {",
View Full Code Here

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

      Context context = new ContextFactory().enterContext();
      context.setOptimizationLevel(-1)// Only running once.
      ScriptableObject globalScope = context.initStandardObjects();
      NativeObject navigator = new NativeObject();
      ScriptableObject.putConstProperty(navigator, "userAgent", "testZilla");
      globalScope.defineProperty("navigator", navigator, ScriptableObject.DONTENUM);

      try {
        String soyutilsPath = getSoyUtilsPath();
        Reader soyutils = new InputStreamReader(new FileInputStream(soyutilsPath), Charsets.UTF_8);
        try {
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.