summaryrefslogtreecommitdiff
path: root/experimental/frisch/test_js.ml
blob: 2582a0fba556e13213fb537245f540a0e21c5d1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module Js = struct
  type +'a t
  type +'a gen_prop
  type +'a meth
  module Unsafe = struct
    type any
    let get (_o : 'a t) (_meth : string) = assert false
    let set (_o : 'a t) (_meth : string) (_v : 'b) = ()
    let meth_call (_ : 'a) (_ : string) (_ : any array) : 'b = assert false
    let inject _ : any = assert false
  end
end

let foo1 o =
  if [%js o.bar] then [%js o.foo1.foo2] else [%js o.foo2]

let foo2 o =
  [%js o.x <- o.x + 1]


let foo3 o a =
  [%js o#x] + [%js o#y 1 a]