ruby2js 3.3.2 → 3.3.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: a7be3ac378426bc010a8e435f3be72cf21e2b0097f75e05c320e972df2d40de2
4
- data.tar.gz: 615394a93302b09a241569996ba0186eda723fafe751ceca62dc4521d0bf3b56
3
+ metadata.gz: a14485c0400fde35f0734d3e237f2b2d7fdda41377c9d26aeede802634a619e4
4
+ data.tar.gz: 3f27f9ac6e92ab7a67823361dfea1b42b09c9dd405dfd7855e278114b3dfccfa
5
5
  SHA512:
6
- metadata.gz: 6309c00069f51a2b78f14f4fb2c7d45364449b82f74a1fc91af420bea17f5b4d112b11963a92873baa1f72b049e4d1060221f2fd59b762f3af6a780063be2eb2
7
- data.tar.gz: ecbed895c7319cbce8e8faafc510a0ab64e4a0e3eb14ed9a2d31ebbef4bcd131d52e8340dbc95d9c6ecdff5dc21c919722e76d74f8f940802b3d55484b1083ae
6
+ metadata.gz: '0953480e1e37ebf92fd62af8a55ef77c203c42b2a4ca2880d623a573feadc5b294319cac53f48f36dc5564f4420425cd238dccf3b4cb2a07aab31b7c474cbb9a'
7
+ data.tar.gz: 600d4fcd56f5da3144a3f48d872bfdd9293e3de233b47b6b3fb5473a4424e1d4db55b59fef9a59f96df2ba82978dea52b6cb0c070929867a89ce2fa0ea170291
@@ -95,6 +95,17 @@ module Ruby2JS
95
95
  elsif not [:lambda, :proc].include? method
96
96
  anonfn = false
97
97
  end
98
+
99
+ # use fat arrow syntax if block contains a reference to 'this'
100
+ if anonfn
101
+ walk = proc do |ast|
102
+ anonfn = false if ast == s(:send, nil, :this)
103
+ ast.children.each do |child|
104
+ walk[child] if child.is_a? Parser::AST::Node
105
+ end
106
+ end
107
+ walk[right]
108
+ end
98
109
  end
99
110
 
100
111
  if \
@@ -2,7 +2,7 @@ module Ruby2JS
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 3
4
4
  MINOR = 3
5
- TINY = 2
5
+ TINY = 3
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.files = %w(ruby2js.gemspec README.md) + Dir.glob("{lib}/**/*")
16
16
  s.homepage = "http://github.com/rubys/ruby2js".freeze
17
17
  s.licenses = ["MIT".freeze]
18
- s.required_ruby_version = Gem::Requirement.new(">= 1.9.3".freeze)
18
+ s.required_ruby_version = Gem::Requirement.new(">= 2.0".freeze)
19
19
  s.summary = "Minimal yet extensible Ruby to JavaScript conversion.".freeze
20
20
 
21
21
  s.add_dependency('parser')
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: 3.3.2
4
+ version: 3.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Ruby
@@ -154,7 +154,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
154
154
  requirements:
155
155
  - - ">="
156
156
  - !ruby/object:Gem::Version
157
- version: 1.9.3
157
+ version: '2.0'
158
158
  required_rubygems_version: !ruby/object:Gem::Requirement
159
159
  requirements:
160
160
  - - ">="