ruby2js 3.0.6 → 3.0.7
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/block.rb +1 -1
- data/lib/ruby2js/converter/def.rb +2 -2
- data/lib/ruby2js/converter/for.rb +1 -1
- data/lib/ruby2js/converter/prototype.rb +4 -1
- data/lib/ruby2js/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1f6b8ccdda1317ddb72ca731897a87304b28925ed71647ce4904b05fc18daeb
|
4
|
+
data.tar.gz: 4a71dd298b6c4f202036b4232b0d230617c75cea380e1f225e3869040daade3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10dd9756d3f8349b0fdb944d7a3dc2202c3cd57f23782aba500a68c02f8a5cc70a2a2c9f4dc9e5725a4bba06a45fb326ab6cdb5604aefb5ec6a397a34b10bc99
|
7
|
+
data.tar.gz: 1fbb8a1e87b2215f4303718b39de422584af3e10134ae85260db649a8ddbb094edcfe7585667fc4a9cadcbf6e74939861f492bfccdce1c44c39746275f7369b4
|
@@ -95,7 +95,7 @@ module Ruby2JS
|
|
95
95
|
put '('; parse args; put ') => '
|
96
96
|
|
97
97
|
expr = body
|
98
|
-
expr = expr.children.first
|
98
|
+
expr = expr.children.first while expr.type == :autoreturn
|
99
99
|
while expr.type == :begin and expr.children.length == 1
|
100
100
|
expr = expr.children.first
|
101
101
|
end
|
@@ -143,7 +143,7 @@ module Ruby2JS
|
|
143
143
|
mark = output_location
|
144
144
|
scope body, vars
|
145
145
|
if @block_this and @block_depth == 1
|
146
|
-
insert mark, "var self = this#{@sep}"
|
146
|
+
insert mark, "#{es2015 ? 'let' : 'var'} self = this#{@sep}"
|
147
147
|
@block_this = false
|
148
148
|
end
|
149
149
|
|
@@ -11,7 +11,10 @@ module Ruby2JS
|
|
11
11
|
prototype, @prototype = @prototype, true
|
12
12
|
mark = output_location
|
13
13
|
parse(expr)
|
14
|
-
|
14
|
+
|
15
|
+
if @block_this
|
16
|
+
insert mark, "#{es2015 ? 'let' : 'var'} self = this#{@sep}"
|
17
|
+
end
|
15
18
|
ensure
|
16
19
|
@prototype = prototype
|
17
20
|
@block_this, @block_depth = nil, nil
|
data/lib/ruby2js/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby2js
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Ruby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
132
|
rubyforge_project:
|
133
|
-
rubygems_version: 2.7.
|
133
|
+
rubygems_version: 2.7.4
|
134
134
|
signing_key:
|
135
135
|
specification_version: 4
|
136
136
|
summary: Minimal yet extensible Ruby to JavaScript conversion.
|