Jean Boussier
1c1770d8b0
Avoid anonymous eval
...
This makes it hard to track down the source of allocations
and such when profiling.
2023-01-11 12:59:15 +01:00
Benoit Daloze
9e0855ddcd
Convert Symbol explicitly to a JS String and add test
2022-07-19 17:17:52 +02:00
Benoit Daloze
19b1e4f9f6
Convert Ruby Strings to TruffleString when passing them to JavaScript
...
* To work around JavaScript not yet preferring JS String methods
to Ruby String methods inside JS code (GR-39371).
2022-07-08 15:24:34 +02:00
Benoit Daloze
c37045ecf6
GraalVM 22.2+ needs gu install js
for JavaScript to be available
2022-07-08 15:24:34 +02:00
Jean Boussier
a8b0f04345
Remove outdated Encoding workaround
2022-03-02 18:29:33 +01:00
Benoit Daloze
4cb60fa266
Adapt ExecJS::GraalJSRuntime to foreign exception changes in TruffleRuby
...
* Foreign exceptions are no longer translated to ::RuntimeError but
remain as foreign exceptions and are given the class Polyglot::ForeignException.
* The backtrace can be nil, notably when throwing a JS string.
2022-03-02 17:18:58 +01:00
Jean Boussier
e2a113c368
Improve Encoding
handling
...
Comparing the Encoding instance directly is more efficient.
Also `ASCII-8BIT` may be renamed in 3.2: https://bugs.ruby-lang.org/issues/18576
2022-02-17 15:03:43 +01:00
Benoit Daloze
071dd2d42b
Add test for passing Symbol to JS and fix it for GraalJSRuntime and RubyRhinoRuntime
...
* Add missing require "json" for ExternalRuntime
2022-01-27 21:50:57 +01:00
Benoit Daloze
e24e381ffc
Remove duplicate delete this.console;
2021-10-19 19:57:30 +02:00
Benoit Daloze
f29ad3e66b
Only warn if $VERBOSE
...
* If the GraalJSRuntime is not used it is not necessarily an issue,
as it e.g. fall back to an ExternalRuntime like node.
2021-10-19 19:34:12 +02:00
Benoit Daloze
05476fab17
Remove extra begin/end for #translate
2021-10-19 19:34:12 +02:00
Benoit Daloze
566d611c23
Add runtime using GraalJS on TruffleRuby
...
* Use Truffle inner contexts to provide correct isolation between ExecJS::Context
* To run the tests:
TRUFFLERUBYOPT="--jvm --polyglot" bundle exec rake test:graaljs TESTOPTS="--seed=0 --verbose"
* Full command without subprocess:
TRUFFLERUBYOPT="--jvm --polyglot" jt -u jvm-js ruby -w -Ilib:test -I $PWD/vendor/bundle/truffleruby/*/gems/rake-13.0.1/lib $PWD/vendor/bundle/truffleruby/*/gems/rake-13.0.1/lib/rake/rake_test_loader.rb test/test_execjs.rb --seed=0 --verbose
* Try command:
TRUFFLERUBYOPT="--jvm --polyglot" jt -u jvm-js ruby -Ilib -rexecjs -e 'p ExecJS.eval("2 + 3")'
2021-10-19 19:34:12 +02:00
Benoit Daloze
181cb0a9d1
Pass Encoding::UTF_8 to String#encode instead of 'UTF-8' for efficiency
2021-10-19 19:34:12 +02:00
Jean Boussier
642fd306be
Fix javascriptcore test suite
2021-10-19 09:51:41 +02:00
Jean Boussier
3e94078793
Restore CI for the V8 runtime
2021-05-15 12:37:38 +02:00
Andrew White
d19a51d43a
ExecJS 2.8.1
2021-05-14 08:42:52 +01:00
Jean Boussier
a6abf130c7
Wait for STDOUT to be flushed before exiting the node runtime
2021-05-14 08:56:09 +02:00
Andrew White
2cac62d20d
ExecJS 2.8.0
2021-05-10 19:58:33 +01:00
Jean Boussier
c5fd11d7b0
Explicitly call process.exit in the node runner to prevent it from hanging
2021-05-07 12:19:55 +02:00
Jean Boussier
1dce3d0778
Update JavaScriptCore path
2021-05-07 12:19:55 +02:00
Jean Boussier
70e8498ebc
Fix a test failure and minitest warnings
2021-05-07 12:19:55 +02:00
Jean Boussier
e44130562d
therubyracer gem is no longer maintained and is incompatible with Ruby 3.0
2021-05-07 10:08:48 +02:00
pavel
c9d2fc6e35
fix deprecation warning
2020-11-16 21:52:58 +01:00
Uchio KONDO
cf0ffffa78
Search node
binary first than nodejs
...
- Many of node.js managers like nodebrew install `node` command
- OS package managers often install `nodejs`, e.g. Debian/Ubuntu
- Thus, if OS has installed older version of `nodejs`,
execjs detects and uses this preferentially
2018-12-18 12:39:04 +09:00
Magnus Holm
a6f6a6cf25
RubyRacer: Force expression in Context#call
2018-06-02 22:02:08 +02:00
Magnus Holm
58a6c49a66
Duktape: Follow correct behavior for Context#call
2018-06-02 21:55:41 +02:00
Magnus Holm
ad0ab1bdde
Add documentation for the Context methods
2018-06-02 21:55:41 +02:00
Andrey Sitnik
562c941e1e
Fix for empty EXECJS_RUNTIME
2017-09-25 17:00:40 +03:00
Joshua Peek
5c6f4a9115
Normalize console
in JSC
2016-06-05 16:04:06 -07:00
Joshua Peek
b0be19c73d
Remove process and other node globals from this
2016-06-05 16:03:21 -07:00
Joshua Peek
af43a575f8
Undefine global process
...
Node specific global should be normalized across environments
2016-06-05 15:49:07 -07:00
Rafael Mendonça França
4f2fc87a55
Release 2.7.0
2016-05-20 00:57:43 -03:00
Sam
f587a97475
add MiniRacer runtime support
2016-05-14 12:25:16 -05:00
Joshua Peek
24d0454d6d
Check arity to support existing runtime classes
2016-04-11 21:49:10 -07:00
Joshua Peek
0539b906aa
Allow for runtime specific option flags
2016-04-11 20:57:37 -07:00
ojab
99bdbb8067
Add direct V8 support (via d3
)
2015-09-09 08:57:17 +00:00
Rafael Mendonça França
f431ca81c6
Release 2.6.0
2015-08-14 14:57:11 -03:00
Rafael Mendonça França
1a92790be6
Merge pull request #12 from lowjoel/master
...
Support checking the PATHEXT variable on Windows.
2015-08-13 21:23:19 -03:00
Pedro Nascimento
2f3d259c45
Use node.js if available instead of JavascriptCore on OSX.
2015-08-13 19:41:42 -03:00
Rafael Mendonça França
329353b7a1
ExecJS 2.5.2
2015-04-09 12:58:21 -03:00
Ivan Buiko
1d91177a03
fix from_environment
...
Addition to the https://github.com/rails/execjs/pull/5
I think it's better to use @const_defined?@
2015-04-09 18:26:41 +03:00
Rafael Mendonça França
a40cb99d53
ExecJS 2.5.1
2015-04-08 19:10:05 -03:00
Joshua Peek
7e514ae13d
ExecJS 2.5.0
2015-04-06 10:07:57 -07:00
Joshua Peek
1e73f2584e
Still prefer v8 over duktape
2015-04-06 10:04:43 -07:00
Joshua Peek
cecfb3c76a
Merge branch 'master' into duktape
2015-04-06 09:59:55 -07:00
Rafael Mendonça França
e8dd15f0c7
Merge pull request #9 from panyamin/patch-2
...
Cygwin support
2015-03-27 15:35:22 -03:00
Ryunosuke SATO
4013fea10b
Update organization name to 'rails'
2015-03-28 00:32:25 +09:00
Benjamin
dc9d2cc16b
Updated filepath for cygwin support
2015-03-20 14:40:20 +01:00
Benjamin
b6ffa1ba43
Added method for cygwin support
2015-03-20 14:38:25 +01:00
Joel Low
7df6bf6ae1
Support checking the PATHEXT variable on Windows.
...
This allows scripts to be detected as a runtime, for circumstances where the actual binary is not in PATH, but a forwarding script is.
2015-03-14 08:55:27 +08:00