ruby2js 4.1.5 → 4.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruby2js/converter.rb +2 -2
- data/lib/ruby2js/converter/logical.rb +2 -2
- data/lib/ruby2js/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f29494a95eb89f049d35d1a431e50e1ac4fb526fbe7544dff5b7c699b2aae9c
|
4
|
+
data.tar.gz: cd87036fc9542ce81e7dedb379ee5eb874f7ea9144096ff7f1b496b2c3bad5a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 574b8d730585898be4ce8506b256f90a9ed092e88edcbe5af82cf5d0f70aa7177b31486deee3b615269fe8011f0b9ac0efb38381bf6df924d04cfddcd5dda799
|
7
|
+
data.tar.gz: 68d618097efa0fc47509129242d84e72349dd3619b9238df83820ade29fca243d7cb19c6627d9fe5b14c64fb3fb6a5fa1d9f1cfa93bd2a5753acb84645a56fc4
|
data/lib/ruby2js/converter.rb
CHANGED
@@ -17,8 +17,8 @@ module Ruby2JS
|
|
17
17
|
|
18
18
|
LOGICAL = :and, :not, :or
|
19
19
|
OPERATORS = [:[], :[]=], [:not, :!], [:**], [:*, :/, :%], [:+, :-],
|
20
|
-
[:>>, :<<], [:&], [:^, :|], [:<=, :<, :>, :>=],
|
21
|
-
[:and, :or]
|
20
|
+
[:>>, :<<], [:&], [:^, :|], [:<=, :<, :>, :>=],
|
21
|
+
[:==, :!=, :===, :"!==", :=~, :!~], [:and, :or]
|
22
22
|
|
23
23
|
INVERT_OP = {
|
24
24
|
:< => :>=,
|
@@ -73,12 +73,12 @@ module Ruby2JS
|
|
73
73
|
s(:and, left, right)
|
74
74
|
elsif conditionally_equals(left, right.children.first)
|
75
75
|
# a && a.b => a&.b
|
76
|
-
right.updated(:csend, [left, right.children
|
76
|
+
right.updated(:csend, [left, *right.children[1..-1]])
|
77
77
|
elsif conditionally_equals(left.children.last, right.children.first)
|
78
78
|
# a && b && b.c => a && b&.c
|
79
79
|
left.updated(:and, [left.children.first,
|
80
80
|
left.children.last.updated(:csend,
|
81
|
-
[left.children.last, right.children
|
81
|
+
[left.children.last, *right.children[1..-1]])])
|
82
82
|
else
|
83
83
|
s(:and, left, right)
|
84
84
|
end
|
data/lib/ruby2js/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Ruby
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-08-
|
12
|
+
date: 2021-08-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: parser
|