Java Code Examples for org.mozilla.javascript.tools.shell.Global#put()
The following examples show how to use
org.mozilla.javascript.tools.shell.Global#put() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: V8Benchmark.java From rhino-android with Apache License 2.0 | 5 votes |
private void runTest(int optLevel) throws IOException { Context cx = RhinoAndroidHelper.prepareContext(); cx.setLanguageVersion(Context.VERSION_1_8); cx.setOptimizationLevel(optLevel); Global root = new Global(cx); TestUtils.addAssetLoading(root); root.put("RUN_NAME", root, "V8-Benchmark-" + optLevel); Object result = cx.evaluateString(root, TestUtils.readAsset(TEST_SRC), TEST_SRC, 1, null); results.put(optLevel, result.toString()); }
Example 2
Source File: SunSpiderBenchmark.java From rhino-android with Apache License 2.0 | 5 votes |
private void runTest(int optLevel) throws IOException { Context cx = RhinoAndroidHelper.prepareContext(); cx.setLanguageVersion(Context.VERSION_1_8); cx.setOptimizationLevel(optLevel); Global root = new Global(cx); TestUtils.addAssetLoading(root); root.put("RUN_NAME", root, "SunSpider-" + optLevel); Object result = cx.evaluateString(root, TestUtils.readAsset(TEST_SRC), TEST_SRC, 1, null); results.put(optLevel, result.toString()); }