Skip to content

Commit d2f8497

Browse files
committed
qualify usages of not
1 parent ca1b51d commit d2f8497

File tree

2 files changed

+26
-21
lines changed

2 files changed

+26
-21
lines changed

ppx/browser/ppx_deriving_json_js.ml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,13 @@ module Of_json = struct
5858
Stdlib.( && )
5959
(Stdlib.( = ) (Js.typeof [%e x]) "object")
6060
(Stdlib.( && )
61-
(not (Js.Array.isArray [%e x]))
62-
(not (Stdlib.( == ) (Obj.magic [%e x] : 'a Js.null) Js.null)))]
61+
(Stdlib.not (Js.Array.isArray [%e x]))
62+
(Stdlib.not
63+
(Stdlib.( == ) (Obj.magic [%e x] : 'a Js.null) Js.null)))]
6364

6465
let ensure_json_object ~loc x =
6566
[%expr
66-
if not [%e eis_json_object ~loc x] then
67+
if Stdlib.not [%e eis_json_object ~loc x] then
6768
Ppx_deriving_json_runtime.of_json_error
6869
[%e estring ~loc (sprintf "expected a JSON object")]]
6970

ppx/test/ppx_deriving_json_js.t

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,13 @@
119119
let rec record_of_json =
120120
(fun x ->
121121
if
122-
not
122+
Stdlib.not
123123
(Stdlib.( && )
124124
(Stdlib.( = ) (Js.typeof x) "object")
125125
(Stdlib.( && )
126-
(not (Js.Array.isArray x))
127-
(not (Stdlib.( == ) (Obj.magic x : 'a Js.null) Js.null))))
126+
(Stdlib.not (Js.Array.isArray x))
127+
(Stdlib.not
128+
(Stdlib.( == ) (Obj.magic x : 'a Js.null) Js.null))))
128129
then
129130
Ppx_deriving_json_runtime.of_json_error "expected a JSON object";
130131
let fs =
@@ -183,12 +184,13 @@
183184
let rec record_aliased_of_json =
184185
(fun x ->
185186
if
186-
not
187+
Stdlib.not
187188
(Stdlib.( && )
188189
(Stdlib.( = ) (Js.typeof x) "object")
189190
(Stdlib.( && )
190-
(not (Js.Array.isArray x))
191-
(not (Stdlib.( == ) (Obj.magic x : 'a Js.null) Js.null))))
191+
(Stdlib.not (Js.Array.isArray x))
192+
(Stdlib.not
193+
(Stdlib.( == ) (Obj.magic x : 'a Js.null) Js.null))))
192194
then
193195
Ppx_deriving_json_runtime.of_json_error "expected a JSON object";
194196
let fs =
@@ -244,12 +246,13 @@
244246
let rec record_opt_of_json =
245247
(fun x ->
246248
if
247-
not
249+
Stdlib.not
248250
(Stdlib.( && )
249251
(Stdlib.( = ) (Js.typeof x) "object")
250252
(Stdlib.( && )
251-
(not (Js.Array.isArray x))
252-
(not (Stdlib.( == ) (Obj.magic x : 'a Js.null) Js.null))))
253+
(Stdlib.not (Js.Array.isArray x))
254+
(Stdlib.not
255+
(Stdlib.( == ) (Obj.magic x : 'a Js.null) Js.null))))
253256
then
254257
Ppx_deriving_json_runtime.of_json_error "expected a JSON object";
255258
let fs = (Obj.magic x : < k : Js.Json.t Js.undefined > Js.t) in
@@ -311,12 +314,12 @@
311314
"expected a JSON array of length 2";
312315
let fs = Js.Array.unsafe_get array 1 in
313316
if
314-
not
317+
Stdlib.not
315318
(Stdlib.( && )
316319
(Stdlib.( = ) (Js.typeof fs) "object")
317320
(Stdlib.( && )
318-
(not (Js.Array.isArray fs))
319-
(not
321+
(Stdlib.not (Js.Array.isArray fs))
322+
(Stdlib.not
320323
(Stdlib.( == )
321324
(Obj.magic fs : 'a Js.null)
322325
Js.null))))
@@ -796,12 +799,13 @@
796799
let rec allow_extra_fields_of_json =
797800
(fun x ->
798801
if
799-
not
802+
Stdlib.not
800803
(Stdlib.( && )
801804
(Stdlib.( = ) (Js.typeof x) "object")
802805
(Stdlib.( && )
803-
(not (Js.Array.isArray x))
804-
(not (Stdlib.( == ) (Obj.magic x : 'a Js.null) Js.null))))
806+
(Stdlib.not (Js.Array.isArray x))
807+
(Stdlib.not
808+
(Stdlib.( == ) (Obj.magic x : 'a Js.null) Js.null))))
805809
then
806810
Ppx_deriving_json_runtime.of_json_error "expected a JSON object";
807811
let fs = (Obj.magic x : < a : Js.Json.t Js.undefined > Js.t) in
@@ -855,12 +859,12 @@
855859
"expected a JSON array of length 2";
856860
let fs = Js.Array.unsafe_get array 1 in
857861
if
858-
not
862+
Stdlib.not
859863
(Stdlib.( && )
860864
(Stdlib.( = ) (Js.typeof fs) "object")
861865
(Stdlib.( && )
862-
(not (Js.Array.isArray fs))
863-
(not
866+
(Stdlib.not (Js.Array.isArray fs))
867+
(Stdlib.not
864868
(Stdlib.( == )
865869
(Obj.magic fs : 'a Js.null)
866870
Js.null))))

0 commit comments

Comments
 (0)