File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -657,6 +657,9 @@ let jsxMapper () =
657
657
let fileName = filenameFromLoc pstr_loc in
658
658
let emptyLoc = Location. in_file fileName in
659
659
let mapBinding binding = if (hasAttrOnBinding binding) then
660
+ let bindingLoc = binding.pvb_loc in
661
+ let bindingPatLoc = binding.pvb_pat.ppat_loc in
662
+ let binding = { binding with pvb_pat = { binding.pvb_pat with ppat_loc = emptyLoc}; pvb_loc = emptyLoc} in
660
663
let fnName = getFnName binding in
661
664
let internalFnName = fnName ^ " $Internal" in
662
665
let fullModuleName = makeModuleName fileName ! nestedModules fnName in
@@ -687,7 +690,11 @@ let jsxMapper () =
687
690
spelunkForFunExpression expression
688
691
in
689
692
let modifiedBinding binding =
690
- let wrapExpressionWithBinding expressionFn expression = Vb. mk ~attrs: (List. filter otherAttrsPure binding.pvb_attributes) (Pat. var {loc = emptyLoc; txt = fnName}) (expressionFn expression) in
693
+ let wrapExpressionWithBinding expressionFn expression =
694
+ Vb. mk
695
+ ~loc: bindingLoc
696
+ ~attrs: (List. filter otherAttrsPure binding.pvb_attributes)
697
+ (Pat. var ~loc: bindingPatLoc {loc = bindingPatLoc; txt = fnName}) (expressionFn expression) in
691
698
let expression = binding.pvb_expr in
692
699
let unerasableIgnoreExp exp = { exp with pexp_attributes = (unerasableIgnore emptyLoc) :: exp.pexp_attributes } in
693
700
(* TODO: there is a long-tail of unsupported features inside of blocks - Pexp_letmodule , Pexp_letexception , Pexp_ifthenelse *)
You can’t perform that action at this time.
0 commit comments