@@ -1461,10 +1461,6 @@ module V4 = struct
1461
1461
(Invalid_argument " JSX: somehow there's more than one `children` label" )
1462
1462
[@@ raises Invalid_argument ]
1463
1463
1464
- let unerasableIgnore loc =
1465
- ( {loc; txt = " warning" },
1466
- PStr [Str. eval (Exp. constant (Pconst_string (" -16" , None )))] )
1467
-
1468
1464
let merlinFocus = ({loc = Location. none; txt = " merlin.focus" }, PStr [] )
1469
1465
1470
1466
(* Helper method to look up the [@react.component] attribute *)
@@ -2148,13 +2144,6 @@ module V4 = struct
2148
2144
(expressionFn expression)
2149
2145
in
2150
2146
let expression = binding.pvb_expr in
2151
- let unerasableIgnoreExp exp =
2152
- {
2153
- exp with
2154
- pexp_attributes =
2155
- unerasableIgnore emptyLoc :: exp .pexp_attributes;
2156
- }
2157
- in
2158
2147
(* TODO: there is a long-tail of unsupported features inside of blocks - Pexp_letmodule , Pexp_letexception , Pexp_ifthenelse *)
2159
2148
let rec spelunkForFunExpression expression =
2160
2149
match expression with
@@ -2167,17 +2156,15 @@ module V4 = struct
2167
2156
pattern,
2168
2157
({pexp_desc = Pexp_fun _} as internalExpression) );
2169
2158
} ->
2170
- let wrap, hasUnit, hasForwardRef, exp =
2159
+ let wrap, hasForwardRef, exp =
2171
2160
spelunkForFunExpression internalExpression
2172
2161
in
2173
2162
( wrap,
2174
- hasUnit,
2175
2163
hasForwardRef,
2176
- unerasableIgnoreExp
2177
- {
2178
- expression with
2179
- pexp_desc = Pexp_fun (label, default, pattern, exp);
2180
- } )
2164
+ {
2165
+ expression with
2166
+ pexp_desc = Pexp_fun (label, default, pattern, exp);
2167
+ } )
2181
2168
(* let make = (()) => ... *)
2182
2169
(* let make = (_) => ... *)
2183
2170
| {
@@ -2191,7 +2178,7 @@ module V4 = struct
2191
2178
},
2192
2179
_internalExpression );
2193
2180
} ->
2194
- ((fun a -> a), true , false , expression)
2181
+ ((fun a -> a), false , expression)
2195
2182
(* let make = (~prop) => ... *)
2196
2183
| {
2197
2184
pexp_desc =
@@ -2201,14 +2188,13 @@ module V4 = struct
2201
2188
_pattern,
2202
2189
_internalExpression );
2203
2190
} ->
2204
- ((fun a -> a), false , false , unerasableIgnoreExp expression)
2191
+ ((fun a -> a), false , expression)
2205
2192
(* let make = (prop) => ... *)
2206
2193
| {
2207
2194
pexp_desc =
2208
2195
Pexp_fun (_nolabel, _default, pattern, _internalExpression);
2209
2196
} ->
2210
- if ! hasApplication then
2211
- ((fun a -> a), false , false , unerasableIgnoreExp expression)
2197
+ if ! hasApplication then ((fun a -> a), false , expression)
2212
2198
else
2213
2199
Location. raise_errorf ~loc: pattern.ppat_loc
2214
2200
" React: props need to be labelled arguments.\n \
@@ -2219,11 +2205,10 @@ module V4 = struct
2219
2205
(* let make = {let foo = bar in (~prop) => ...} *)
2220
2206
| {pexp_desc = Pexp_let (recursive , vbs , internalExpression )} ->
2221
2207
(* here's where we spelunk! *)
2222
- let wrap, hasUnit, hasForwardRef, exp =
2208
+ let wrap, hasForwardRef, exp =
2223
2209
spelunkForFunExpression internalExpression
2224
2210
in
2225
2211
( wrap,
2226
- hasUnit,
2227
2212
hasForwardRef,
2228
2213
{expression with pexp_desc = Pexp_let (recursive, vbs, exp)}
2229
2214
)
@@ -2233,38 +2218,31 @@ module V4 = struct
2233
2218
Pexp_apply (wrapperExpression, [(Nolabel , internalExpression)]);
2234
2219
} ->
2235
2220
let () = hasApplication := true in
2236
- let _, hasUnit, _, exp =
2237
- spelunkForFunExpression internalExpression
2238
- in
2221
+ let _, _, exp = spelunkForFunExpression internalExpression in
2239
2222
let hasForwardRef = isForwardRef wrapperExpression in
2240
2223
( (fun exp -> Exp. apply wrapperExpression [(nolabel, exp)]),
2241
- hasUnit,
2242
2224
hasForwardRef,
2243
2225
exp )
2244
2226
| {
2245
2227
pexp_desc = Pexp_sequence (wrapperExpression, internalExpression);
2246
2228
} ->
2247
- let wrap, hasUnit, hasForwardRef, exp =
2229
+ let wrap, hasForwardRef, exp =
2248
2230
spelunkForFunExpression internalExpression
2249
2231
in
2250
2232
( wrap,
2251
- hasUnit,
2252
2233
hasForwardRef,
2253
2234
{
2254
2235
expression with
2255
2236
pexp_desc = Pexp_sequence (wrapperExpression, exp);
2256
2237
} )
2257
- | e -> ((fun a -> a), false , false , e)
2238
+ | e -> ((fun a -> a), false , e)
2258
2239
in
2259
- let wrapExpression, hasUnit, hasForwardRef, expression =
2240
+ let wrapExpression, hasForwardRef, expression =
2260
2241
spelunkForFunExpression expression
2261
2242
in
2262
- ( wrapExpressionWithBinding wrapExpression,
2263
- hasUnit,
2264
- hasForwardRef,
2265
- expression )
2243
+ (wrapExpressionWithBinding wrapExpression, hasForwardRef, expression)
2266
2244
in
2267
- let bindingWrapper, _hasUnit, hasForwardRef, expression =
2245
+ let bindingWrapper, hasForwardRef, expression =
2268
2246
modifiedBinding binding
2269
2247
in
2270
2248
(* do stuff here! *)
0 commit comments