execjs 2.9.1 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/lib/execjs/graaljs_runtime.rb +1 -2
- data/lib/execjs/support/bun_runner.js +4 -4
- data/lib/execjs/version.rb +1 -1
- data/lib/execjs.rb +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5608786a34b58a8a7f8a09df2a3fec055a1e00064b5f56e0c24b05c01c33088
|
4
|
+
data.tar.gz: b5c80c0022c4c8d15466effb2f58fb1fc07f8e7cb2ba7bb44b0a0c764c82438d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e889653dcb5c76b7b7bfad4ac46135174f8f0cd0fd5e58b63d2d3c1ed6812b1e37e772223c46aba1afeab58b9eb32b7fed8d7686e55465ae12fa67640405ded
|
7
|
+
data.tar.gz: 327326bebc0135ba9d2964d28bff46e6db20801d9842760e247e960a4da55789efc5046071f34314bbe9e0e0f978c50289412dde9b10d03daa95e87b5eb8f608
|
data/README.md
CHANGED
@@ -31,8 +31,8 @@ A longer example, demonstrating how to invoke the CoffeeScript compiler:
|
|
31
31
|
|
32
32
|
``` ruby
|
33
33
|
require "execjs"
|
34
|
-
require "
|
35
|
-
source =
|
34
|
+
require "net/http"
|
35
|
+
source = Net::HTTP.get(URI("https://coffeescript.org/browser-compiler-legacy/coffeescript.js"))
|
36
36
|
|
37
37
|
context = ExecJS.compile(source)
|
38
38
|
context.call("CoffeeScript.compile", "square = (x) -> x * x", bare: true)
|
@@ -41,7 +41,7 @@ context.call("CoffeeScript.compile", "square = (x) -> x * x", bare: true)
|
|
41
41
|
|
42
42
|
# Forcing a specific runtime
|
43
43
|
|
44
|
-
If you'd like to use a specific runtime rather than the
|
44
|
+
If you'd like to use a specific runtime rather than the autodetected one, you can assign `ExecJS.runtime`:
|
45
45
|
|
46
46
|
```ruby
|
47
47
|
ExecJS.runtime = ExecJS::Runtimes::Node
|
@@ -65,7 +65,7 @@ $ gem install execjs
|
|
65
65
|
|
66
66
|
**Why can't I use CommonJS `require()` inside ExecJS?**
|
67
67
|
|
68
|
-
ExecJS provides
|
68
|
+
ExecJS provides the lowest common denominator interface to any JavaScript runtime.
|
69
69
|
Use ExecJS when it doesn't matter which JavaScript interpreter your code runs
|
70
70
|
in. If you want to access the Node API, you should check another library like
|
71
71
|
[commonjs.rb](https://github.com/cowboyd/commonjs.rb) designed to provide a
|
@@ -92,7 +92,7 @@ You shouldn't use `ExecJS.eval` on any inputs you wouldn't feel comfortable Ruby
|
|
92
92
|
|
93
93
|
## Contributing to ExecJS
|
94
94
|
|
95
|
-
ExecJS is work of dozens of contributors. You're encouraged to submit pull requests, propose
|
95
|
+
ExecJS is the work of dozens of contributors. You're encouraged to submit pull requests, propose
|
96
96
|
features and discuss issues.
|
97
97
|
|
98
98
|
See [CONTRIBUTING](CONTRIBUTING.md).
|
@@ -136,8 +136,7 @@ module ExecJS
|
|
136
136
|
|
137
137
|
unless Polyglot.languages.include? "js"
|
138
138
|
warn "The language 'js' is not available, you likely need to `export TRUFFLERUBYOPT='--jvm --polyglot'`", uplevel: 0 if $VERBOSE
|
139
|
-
warn "You also need to install the 'js' component
|
140
|
-
warn "Note that you need TruffleRuby+GraalVM and not just the TruffleRuby standalone to use #{self.class}", uplevel: 0 if $VERBOSE
|
139
|
+
warn "You also need to install the 'js' component, see https://github.com/oracle/truffleruby/blob/master/doc/user/polyglot.md#installing-other-languages", uplevel: 0 if $VERBOSE
|
141
140
|
return @available = false
|
142
141
|
end
|
143
142
|
|
@@ -1,17 +1,17 @@
|
|
1
|
-
(function(program, execJS) { (function() {execJS(program) }).call({}); })(function(self, global, process, module, exports, require, console, setTimeout, setInterval, clearTimeout, clearInterval, setImmediate, clearImmediate) { #{source}
|
2
|
-
}, function(program) {
|
1
|
+
(function(program, execJS) { (function() {execJS(program) }).call({}); })(async function(self, global, process, module, exports, require, console, setTimeout, setInterval, clearTimeout, clearInterval, setImmediate, clearImmediate) { #{source}
|
2
|
+
}, async function(program) {
|
3
3
|
// Force BunJS to use sloppy mode see https://github.com/oven-sh/bun/issues/4527#issuecomment-1709520894
|
4
4
|
exports.abc = function(){}
|
5
5
|
var __process__ = process;
|
6
6
|
var printFinal = function(string) {
|
7
|
-
|
7
|
+
Bun.write(Bun.stdout, '' + string).then(function() {
|
8
8
|
__process__.exit(0);
|
9
9
|
});
|
10
10
|
};
|
11
11
|
try {
|
12
12
|
delete this.process;
|
13
13
|
delete this.console;
|
14
|
-
result = program();
|
14
|
+
result = await program();
|
15
15
|
process = __process__;
|
16
16
|
if (typeof result == 'undefined' && result !== null) {
|
17
17
|
printFinal('["ok"]');
|
data/lib/execjs/version.rb
CHANGED
data/lib/execjs.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: execjs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Stephenson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-10-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -72,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: '0'
|
74
74
|
requirements: []
|
75
|
-
rubygems_version: 3.
|
75
|
+
rubygems_version: 3.5.11
|
76
76
|
signing_key:
|
77
77
|
specification_version: 4
|
78
78
|
summary: Run JavaScript code from Ruby
|