opal-optimizer 0.1.2 → 0.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: d76a6684777438ef696216358695d66b0e2ddd212f5b9d28d482843c912a2ac4
4
- data.tar.gz: 536b978277f2af33f5ac47ad8661629e151d54adf11d88f8e0a63487327956d2
3
+ metadata.gz: 95f417ee4f6e6c9089df85ffb552743254b8ce925fff838f43534a393bfdc5d2
4
+ data.tar.gz: 055757cb6d70b74694b4ba832da05214a4109538d2ff9dbd8e44d4f8ba559079
5
5
  SHA512:
6
- metadata.gz: 3e87db8dbc1976b663dfc0fcbbc25b3317058e06c72f759b131e16caeaf589355f85e029e2307392ba386f8c7787128a70a39743570a2d854f327f8b054187fb
7
- data.tar.gz: f29200eb79910e28c08acf486e3881468ec0b5cdc8718787a0e719193e6a2ac1b96c9b43acfc5fbcfe2158e710ce19371d67795521119fbd448db216f87512f4
6
+ metadata.gz: 3a84df0108a0ba76605adcf72f8fd0d1fc71ab7ffa1811227101974dd59a20efd4381ee8cdcd20cffc72f2ca2712f94f5692b94e5f221ece6a10f7c64a162050
7
+ data.tar.gz: b21f95b69e040276fbee5bc0f829fb1536541c0877229ed78c067f79f2f6e08328c5d808caf3f1e5ae9d9f51a8ada7ba97e54a0420f0492fbaeb8815d9d71e63
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ gem "rake", "~> 12.0"
7
7
  gem "rspec", "~> 3.0"
8
8
 
9
9
  gem "opal", path: "../opal"
10
- gem "opal-sprockets", path: "../opal-sprockets"
10
+ gem "opal-sprockets"
11
11
  gem "opal-browser", path: "../opal-browser"
12
12
 
13
13
  gem "rkelly-turbo", path: "../rkelly-turbo"
data/Gemfile.lock CHANGED
@@ -5,18 +5,10 @@ PATH
5
5
  opal (>= 1.0, < 2.0)
6
6
  paggio
7
7
 
8
- PATH
9
- remote: ../opal-sprockets
10
- specs:
11
- opal-sprockets (1.0.0)
12
- opal (>= 1.0, < 1.2)
13
- sprockets (~> 4.0)
14
- tilt (>= 1.4)
15
-
16
8
  PATH
17
9
  remote: ../opal
18
10
  specs:
19
- opal (1.1.1)
11
+ opal (1.2.0)
20
12
  ast (>= 2.3.0)
21
13
  parser (~> 3.0)
22
14
 
@@ -28,7 +20,7 @@ PATH
28
20
  PATH
29
21
  remote: .
30
22
  specs:
31
- opal-optimizer (0.1.2)
23
+ opal-optimizer (0.1.3)
32
24
  opal (>= 1.0.0)
33
25
  rkelly-turbo
34
26
 
@@ -37,30 +29,34 @@ GEM
37
29
  specs:
38
30
  ast (2.4.2)
39
31
  coderay (1.1.3)
40
- concurrent-ruby (1.1.8)
32
+ concurrent-ruby (1.1.9)
41
33
  diff-lcs (1.4.4)
42
34
  method_source (1.0.0)
35
+ opal-sprockets (1.0.1)
36
+ opal (>= 1.0, < 2.0)
37
+ sprockets (~> 4.0)
38
+ tilt (>= 1.4)
43
39
  paggio (0.2.6)
44
- parser (3.0.1.1)
40
+ parser (3.0.2.0)
45
41
  ast (~> 2.4.1)
46
- pry (0.13.1)
42
+ pry (0.14.1)
47
43
  coderay (~> 1.1)
48
44
  method_source (~> 1.0)
49
45
  rack (2.2.3)
50
46
  rake (12.3.3)
51
- rspec (3.9.0)
52
- rspec-core (~> 3.9.0)
53
- rspec-expectations (~> 3.9.0)
54
- rspec-mocks (~> 3.9.0)
55
- rspec-core (3.9.2)
56
- rspec-support (~> 3.9.3)
57
- rspec-expectations (3.9.2)
47
+ rspec (3.10.0)
48
+ rspec-core (~> 3.10.0)
49
+ rspec-expectations (~> 3.10.0)
50
+ rspec-mocks (~> 3.10.0)
51
+ rspec-core (3.10.1)
52
+ rspec-support (~> 3.10.0)
53
+ rspec-expectations (3.10.1)
58
54
  diff-lcs (>= 1.2.0, < 2.0)
59
- rspec-support (~> 3.9.0)
60
- rspec-mocks (3.9.1)
55
+ rspec-support (~> 3.10.0)
56
+ rspec-mocks (3.10.2)
61
57
  diff-lcs (>= 1.2.0, < 2.0)
62
- rspec-support (~> 3.9.0)
63
- rspec-support (3.9.3)
58
+ rspec-support (~> 3.10.0)
59
+ rspec-support (3.10.2)
64
60
  ruby-prof (1.4.3)
65
61
  sprockets (4.0.2)
66
62
  concurrent-ruby (~> 1.0)
@@ -74,7 +70,7 @@ DEPENDENCIES
74
70
  opal!
75
71
  opal-browser!
76
72
  opal-optimizer!
77
- opal-sprockets!
73
+ opal-sprockets
78
74
  pry
79
75
  rake (~> 12.0)
80
76
  rkelly-turbo!
@@ -12,6 +12,7 @@ class TreeShaking < Step
12
12
  method_defs = corelib_calls["def"] +
13
13
  corelib_calls["defs"] +
14
14
  corelib_calls["defn"] +
15
+ corelib_calls["udef"] +
15
16
  aliases.keys
16
17
 
17
18
  method_calls = Set.new
@@ -44,16 +45,23 @@ class TreeShaking < Step
44
45
  method_calls += aliases.values
45
46
 
46
47
  # Protected methods
47
- method_calls += ["$register", "$negative?"]
48
+ method_calls += []
48
49
 
49
50
  removed = Set.new
50
51
 
51
52
  method_defs.each do |m|
52
53
  name = m.arguments.value[1]
53
- next unless StringNode === name
54
-
55
- name = name.value[1..-2]
56
- name = "$" + name if m.value.accessor == "alias"
54
+ case name
55
+ when AddNode
56
+ if StringNode === name.left && StringNode === name.value
57
+ name = name.left.value[1..-2] + name.value.value[1..-2]
58
+ end
59
+ when StringNode
60
+ name = name.value[1..-2]
61
+ name = "$" + name if m.value.accessor == "alias"
62
+ else
63
+ next
64
+ end
57
65
 
58
66
  next if method_calls.include? name
59
67
 
@@ -1,5 +1,5 @@
1
1
  module Opal
2
2
  class Optimizer
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-optimizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - hmdne
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-26 00:00:00.000000000 Z
11
+ date: 2021-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rkelly-turbo