ruby2js 4.1.2 → 4.1.3
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/lib/ruby2js/converter/send.rb +3 -3
- data/lib/ruby2js/filter/camelCase.rb +13 -0
- data/lib/ruby2js/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 447f78e50320a18d86c8b6812ab6e45c67c4b25972e1c0e36466a364440d0738
|
4
|
+
data.tar.gz: f7b98307a552c859cea2e74724b5029796171a7ac843a953a0dc227340caf8f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/ruby2js/version.rb
CHANGED
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.
|
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-
|
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.
|
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: []
|