execjs 2.9.1 → 2.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2cff0ab13dcd1bc38d12b1ca38d99773ba123ad75573c8b8f4789232677df308
4
- data.tar.gz: a84d80b533fa677491bdb26d28bfedd44443deb5ff772d9eeb7db7e9e0d0ab36
3
+ metadata.gz: b5608786a34b58a8a7f8a09df2a3fec055a1e00064b5f56e0c24b05c01c33088
4
+ data.tar.gz: b5c80c0022c4c8d15466effb2f58fb1fc07f8e7cb2ba7bb44b0a0c764c82438d
5
5
  SHA512:
6
- metadata.gz: fbac63f192c113786e7df0bce663a0e40a241b54534e01f18047d356d7ccb1514e4aeb8a610a336f85271def9b5956404091caccf6f0c984a20a723f67a364ce
7
- data.tar.gz: 2f6dfe9ff9154500ea26a0c94a829eacb8b63ac84744791eff8f0b8643182f30118b1f1ed42f08486a4cc05c4e61c0cb8d800df53dcbccdbba5dadb786027b7a
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 "open-uri"
35
- source = open("http://coffeescript.org/extras/coffee-script.js").read
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 autodected one, you can assign `ExecJS.runtime`:
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 a lowest common denominator interface to any JavaScript runtime.
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 with 'gu install js' on GraalVM 22.2+", uplevel: 0 if $VERBOSE
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
- process.stdout.write('' + string, function() {
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"]');
@@ -1,3 +1,3 @@
1
1
  module ExecJS
2
- VERSION = "2.9.1"
2
+ VERSION = "2.10.0"
3
3
  end
data/lib/execjs.rb CHANGED
@@ -2,5 +2,7 @@ require "execjs/module"
2
2
  require "execjs/runtimes"
3
3
 
4
4
  module ExecJS
5
- self.runtime ||= Runtimes.autodetect
5
+ def self.runtime
6
+ @runtime ||= Runtimes.autodetect
7
+ end
6
8
  end
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.9.1
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: 2023-09-16 00:00:00.000000000 Z
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.3.7
75
+ rubygems_version: 3.5.11
76
76
  signing_key:
77
77
  specification_version: 4
78
78
  summary: Run JavaScript code from Ruby