ruby2js 4.1.2 → 4.1.3

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: 696f01a3f2781f8821257f1d2d0ed832e45a9fbde25c2f6f9f200ced90b24dab
4
- data.tar.gz: d4bc6d38fb7146b3615e621e7c86fc8e864895d377d10ecf69599fa60b7808d3
3
+ metadata.gz: 447f78e50320a18d86c8b6812ab6e45c67c4b25972e1c0e36466a364440d0738
4
+ data.tar.gz: f7b98307a552c859cea2e74724b5029796171a7ac843a953a0dc227340caf8f7
5
5
  SHA512:
6
- metadata.gz: f82772a1dc3aefde7a5acb6b7ca3b05a083dbb3e4c9bbdcf585387ae950c6d410280dfe069d0be3d5fd5e28a5eb0524f2c35ccac83c3b9789109a45e2ceb29a9
7
- data.tar.gz: dffb0cd058bc9cdf28b76e99d73cb4916792bd9160ff9516994b3de2bc1b46e22c5d5be9bb772ec0f62c5947f5d73218e9d5fbd69e5e8a28b450875b92940ed7
6
+ metadata.gz: e0ac7541cfe5adc0b2a0d434cac81a1b37d216f3b94a870380e47452133b33d2b19c38eb6b90d70ae1b9336b89cde7db91251572d3c40990fddac65a34cd9e00
7
+ data.tar.gz: ad597409c14874aa0f42511f5f7795b49746385c739d27ff11ab0e392ad692963adac799c07583b0c953db303674bdf2dabdefd4c0dd776b43cbdc8c47ea3330
@@ -323,13 +323,13 @@ module Ruby2JS
323
323
  put 'typeof '; parse args.first
324
324
 
325
325
  elsif ast.children[1] == :is_a? and receiver and args.length == 1
326
- parse receiver; put ' instanceof '; parse args.first
326
+ put '('; parse receiver; put ' instanceof '; parse args.first; put ')'
327
327
 
328
328
  elsif ast.children[1] == :kind_of? and receiver and args.length == 1
329
- parse receiver; put ' instanceof '; parse args.first
329
+ put '('; parse receiver; put ' instanceof '; parse args.first; put ')'
330
330
 
331
331
  elsif ast.children[1] == :instance_of? and receiver and args.length == 1
332
- parse s(:send, s(:attr, receiver, :constructor), :==, args.first)
332
+ put '('; parse s(:send, s(:attr, receiver, :constructor), :==, args.first); put ')'
333
333
 
334
334
  else
335
335
  if method == :bind and receiver&.type == :send
@@ -14,6 +14,9 @@ module Ruby2JS
14
14
  attr_reader
15
15
  attr_writer
16
16
  method_missing
17
+ is_a?
18
+ kind_of?
19
+ instance_of?
17
20
  }
18
21
 
19
22
  CAPS_EXCEPTIONS = {
@@ -28,6 +31,8 @@ module Ruby2JS
28
31
  }
29
32
 
30
33
  def camelCase(symbol)
34
+ return symbol if ALLOWLIST.include?(symbol.to_s)
35
+
31
36
  should_symbolize = symbol.is_a?(Symbol)
32
37
  symbol = symbol
33
38
  .to_s
@@ -111,6 +116,14 @@ module Ruby2JS
111
116
  handle_generic_node(super, :cvasgn)
112
117
  end
113
118
 
119
+ def on_match_pattern(node)
120
+ handle_generic_node(super, :match_pattern)
121
+ end
122
+
123
+ def on_match_var(node)
124
+ handle_generic_node(super, :match_var)
125
+ end
126
+
114
127
  def on_sym(node)
115
128
  handle_generic_node(super, :sym)
116
129
  end
@@ -2,7 +2,7 @@ module Ruby2JS
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 4
4
4
  MINOR = 1
5
- TINY = 2
5
+ TINY = 3
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby2js
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.2
4
+ version: 4.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Ruby
8
8
  - Jared White
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-04-11 00:00:00.000000000 Z
12
+ date: 2021-04-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: parser
@@ -174,7 +174,7 @@ homepage: http://github.com/rubys/ruby2js
174
174
  licenses:
175
175
  - MIT
176
176
  metadata: {}
177
- post_install_message:
177
+ post_install_message:
178
178
  rdoc_options: []
179
179
  require_paths:
180
180
  - lib
@@ -189,8 +189,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  - !ruby/object:Gem::Version
190
190
  version: '0'
191
191
  requirements: []
192
- rubygems_version: 3.1.2
193
- signing_key:
192
+ rubygems_version: 3.2.15
193
+ signing_key:
194
194
  specification_version: 4
195
195
  summary: Minimal yet extensible Ruby to JavaScript conversion.
196
196
  test_files: []