fwi 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fwi.gemspec +1 -1
- data/lib/fwi/compilers/js/gen.rb +7 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3b629c26f6de53dcada43907b1f5bd35ad3fdb8
|
4
|
+
data.tar.gz: b01d3b6214332bd3256b166fe0b8b898c2dcc643
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f03f6db426aecbfc0c6aa0514e46983c7aad1ee259126d29de9eaa23a08185a97dc471351ec7671d8f39b3f02e5d4d024a9512e7ee8efee9a30ee8aa3103ca9a
|
7
|
+
data.tar.gz: 682943fd84c6e43c68d7a0adc6f3309afa45dcff59eec280c37de6f5e896f21bebe12171dc9e8527dce8562a506a18b9f7f7f09b7779d88d513e27b5dc78db27
|
data/fwi.gemspec
CHANGED
data/lib/fwi/compilers/js/gen.rb
CHANGED
@@ -100,15 +100,16 @@ module Generator
|
|
100
100
|
def gen_for_ns parent, name, ns, str, indent
|
101
101
|
is_root = name == "<root>"
|
102
102
|
has_parent = parent != "<root>"
|
103
|
-
unless has_parent
|
104
|
-
append str, indent, "var #{name} = {};" unless is_root
|
105
|
-
else
|
106
|
-
append str, indent, "#{parent}.#{name} = {};" unless is_root
|
107
|
-
end
|
108
103
|
|
109
104
|
fqn_ns = name
|
110
105
|
fqn_ns = parent + "." + fqn_ns if has_parent
|
111
106
|
|
107
|
+
unless has_parent
|
108
|
+
append str, indent, "var #{name} = FWI.util.exports().#{fqn_ns} || {};" unless is_root
|
109
|
+
else
|
110
|
+
append str, indent, "#{fqn_ns} = FWI.util.exports().#{fqn_ns} || {};" unless is_root
|
111
|
+
end
|
112
|
+
|
112
113
|
unless is_root
|
113
114
|
append(str, indent, "FWI.util.exports().#{fqn_ns} = #{fqn_ns};")
|
114
115
|
end
|
@@ -137,7 +138,7 @@ module Generator
|
|
137
138
|
append str, indent, "};"
|
138
139
|
end
|
139
140
|
|
140
|
-
if is_root
|
141
|
+
if is_root && element[:type] != :namespace
|
141
142
|
append(str, indent, "FWI.util.exports().#{fqn} = #{fqn};")
|
142
143
|
end
|
143
144
|
end
|