JavaScript Runtimes

A set of utility classes to execute code on a few JavaScript runtimes.

Категории

Категории

JavaScript Языки программирования
Группа

Группа

org.slieb
Идентификатор

Идентификатор

js-runtimes
Последняя версия

Последняя версия

1.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

JavaScript Runtimes
A set of utility classes to execute code on a few JavaScript runtimes.
Ссылка на сайт

Ссылка на сайт

http://stefanliebenberg.github.io/js-runtimes/
Система контроля версий

Система контроля версий

https://github.com/StefanLiebenberg/js-runtimes

Скачать js-runtimes

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.slieb/js-runtimes/ -->
<dependency>
    <groupId>org.slieb</groupId>
    <artifactId>js-runtimes</artifactId>
    <version>1.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.slieb/js-runtimes/
implementation 'org.slieb:js-runtimes:1.1'
// https://jarcasting.com/artifacts/org.slieb/js-runtimes/
implementation ("org.slieb:js-runtimes:1.1")
'org.slieb:js-runtimes:jar:1.1'
<dependency org="org.slieb" name="js-runtimes" rev="1.1">
  <artifact name="js-runtimes" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.slieb', module='js-runtimes', version='1.1')
)
libraryDependencies += "org.slieb" % "js-runtimes" % "1.1"
[org.slieb/js-runtimes "1.1"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.mozilla : rhino jar 1.7.6
commons-io : commons-io jar 2.4
com.google.guava : guava jar 18.0

provided (1)

Идентификатор библиотеки Тип Версия
org.seleniumhq.selenium : selenium-remote-driver Необязательный jar 2.45.0

test (2)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
org.mockito : mockito-all jar 2.0.2-beta

Модули Проекта

Данный проект не имеет модулей.

js-runtimes

Interface

JavaScriptRuntime is a simple interface intented for use in libraries that want to remain agnostic as to which runtime they are operating on.

Implementations:

###RhinoRuntime

The rhino runtime provides a wrapper around the rhino javascript engine.

  RhinoRuntime runtime = new RhinoRuntime();
  runtime.initialize();
  runtime.execute("var x = 1;", "/path.js");
  runtime.execute("x;"); // 1
  runtime.close();

###EnvJsRuntime

This runtime extends the rhino runtime and adds envjs support for the DOM.

  EnvJsRuntime runtime = new EvnJsRuntime();
  runtime.initialize();
  // do stuff with runtime
  runtime.close();

Misc

Note: This repo contains a monkey patched version of rhino's BaseFunction class to lend support to Function.caller from inside some functions.

Версии библиотеки

Версия
1.1
1.0