on master help sign in
Change the way properties work (remove JSPropRef)
4c3beddHamish Mackenzie
jsaddle.cabal−1
@@ -58,7 +58,6 @@ library
58 buildable: True
58 buildable: True
59 default-language: Haskell2010
59 default-language: Haskell2010
60 hs-source-dirs: src
60 hs-source-dirs: src
61− other-modules: Language.Javascript.JSaddle.PropRef
62 ghc-options: -ferror-spans
61 ghc-options: -ferror-spans
63
62
64test-suite test-tool
63test-suite test-tool
src/Language/Javascript/JSaddle/Classes.hs−6
@@ -18,14 +18,12 @@ module Language.Javascript.JSaddle.Classes (
18 , MakeStringRef(..)
18 , MakeStringRef(..)
19 , MakeArgRefs(..)
19 , MakeArgRefs(..)
20 , MakeObject(..)
20 , MakeObject(..)
21− , MakePropRef(..)
22) where
21) where
23
22
24import Control.Monad.IO.Class (MonadIO)
23import Control.Monad.IO.Class (MonadIO)
25import Language.Javascript.JSaddle.Types
24import Language.Javascript.JSaddle.Types
26 (Object(..), JSStringRef, JSValueRef)
25 (Object(..), JSStringRef, JSValueRef)
27import Language.Javascript.JSaddle.Monad (JSM)
26import Language.Javascript.JSaddle.Monad (JSM)
28−import Language.Javascript.JSaddle.PropRef (JSPropRef)
29
27
30-- | Anything that can be used to make a JavaScript value reference
28-- | Anything that can be used to make a JavaScript value reference
31class MakeValueRef a where
29class MakeValueRef a where
@@ -44,10 +42,6 @@ class MakeArgRefs this where
44class MakeObject this where
42class MakeObject this where
45 makeObject :: this -> JSM Object
43 makeObject :: this -> JSM Object
46
44
47−-- | Anything that can be used to make a JavaScript property reference
48−class MakePropRef this where
49− makePropRef :: this -> JSM JSPropRef
50−
51instance MakeValueRef Object where
45instance MakeValueRef Object where
52 makeValueRef (Object r) = return r
46 makeValueRef (Object r) = return r
53 {-# INLINE makeValueRef #-}
47 {-# INLINE makeValueRef #-}
src/Language/Javascript/JSaddle/Object.hs+144−43
@@ -27,6 +27,7 @@ module Language.Javascript.JSaddle.Object (
27 , (!)
27 , (!)
28 , (!!)
28 , (!!)
29 , js
29 , js
30+ , jss
30 , JSF(..)
31 , JSF(..)
31 , jsf
32 , jsf
32 , js0
33 , js0
@@ -36,12 +37,21 @@ module Language.Javascript.JSaddle.Object (
36 , js4
37 , js4
37 , js5
38 , js5
38 , jsg
39 , jsg
40+ , jsgf
41+ , jsg0
42+ , jsg1
43+ , jsg2
44+ , jsg3
45+ , jsg4
46+ , jsg5
39
47
40 -- * Setting the value of a property
48 -- * Setting the value of a property
41 , (<#)
49 , (<#)
50+ , (<##)
42
51
43 -- * Calling JavaSctipt
52 -- * Calling JavaSctipt
44 , (#)
53 , (#)
54+ , (##)
45 , new
55 , new
46 , call
56 , call
47 , obj
57 , obj
@@ -108,10 +118,8 @@ import Foreign (peekArray, nullPtr, withArrayLen)
108import Language.Javascript.JSaddle.Exception (rethrow)
118import Language.Javascript.JSaddle.Exception (rethrow)
109import Language.Javascript.JSaddle.Value
119import Language.Javascript.JSaddle.Value
110 (JSUndefined, valMakeUndefined, valToObject)
120 (JSUndefined, valMakeUndefined, valToObject)
111−import Language.Javascript.JSaddle.PropRef (JSPropRef(..))
112import Language.Javascript.JSaddle.Classes
121import Language.Javascript.JSaddle.Classes
113− (MakeValueRef(..), MakeStringRef(..), MakeArgRefs(..), MakePropRef(..),
122+ (MakeValueRef(..), MakeStringRef(..), MakeArgRefs(..), MakeObject(..))
114− MakeObject(..))
115import Language.Javascript.JSaddle.Monad
123import Language.Javascript.JSaddle.Monad
116 (JSM)
124 (JSM)
117import Control.Monad.Trans.Reader (runReaderT, ask)
125import Control.Monad.Trans.Reader (runReaderT, ask)
@@ -136,38 +144,34 @@ instance MakeObject v => MakeObject (JSM v) where
136 makeObject v = v >>= makeObject
144 makeObject v = v >>= makeObject
137 {-# INLINE makeObject #-}
145 {-# INLINE makeObject #-}
138
146
139−-- | Lookup a property based on its name. This function just constructs a JSPropRef
147+-- | Lookup a property based on its name.
140−-- the lookup is delayed until we use the JSPropRef. This makes it a bit lazy compared
141−-- to JavaScript's @.@ operator.
142--
148--
143-- >>> testJSaddle $ eval "'Hello World'.length"
149-- >>> testJSaddle $ eval "'Hello World'.length"
144-- >>> testJSaddle $ val "Hello World" ! "length"
150-- >>> testJSaddle $ val "Hello World" ! "length"
145-- 11
151-- 11
146(!) :: (MakeObject this, MakeStringRef name)
152(!) :: (MakeObject this, MakeStringRef name)
147− => this -- ^ Object to look on
153+ => this -- ^ Object to look on
148− -> name -- ^ Name of the property to find
154+ -> name -- ^ Name of the property to find
149− -> JSM JSPropRef -- ^ Property reference
155+ -> JSM JSValueRef -- ^ Property reference
150this ! name = do
156this ! name = do
151 rthis <- makeObject this
157 rthis <- makeObject this
152− return (JSPropRef rthis rname)
158+ rethrow $ objGetPropertyByName rthis rname
153 where
159 where
154 rname = makeStringRef name
160 rname = makeStringRef name
155{-# INLINE (!) #-}
161{-# INLINE (!) #-}
156
162
157−-- | Lookup a property based on its index. This function just constructs a JSPropRef
163+-- | Lookup a property based on its index.
158−-- the lookup is delayed until we use the JSPropRef. This makes it a bit lazy compared
159−-- to JavaScript's @[]@ operator.
160--
164--
161-- >>> testJSaddle $ eval "'Hello World'[6]"
165-- >>> testJSaddle $ eval "'Hello World'[6]"
162-- >>> testJSaddle $ val "Hello World" !! 6
166-- >>> testJSaddle $ val "Hello World" !! 6
163-- W
167-- W
164(!!) :: (MakeObject this)
168(!!) :: (MakeObject this)
165− => this -- ^ Object to look on
169+ => this -- ^ Object to look on
166− -> Index -- ^ Index of the property to lookup
170+ -> Index -- ^ Index of the property to lookup
167− -> JSM JSPropRef -- ^ Property reference
171+ -> JSM JSValueRef -- ^ Property reference
168this !! index = do
172this !! index = do
169 rthis <- makeObject this
173 rthis <- makeObject this
170− return (JSPropIndexRef rthis index)
174+ rethrow $ objGetPropertyAtIndex rthis index
171{-# INLINE (!!) #-}
175{-# INLINE (!!) #-}
172
176
173-- | Makes a getter for a particular property name.
177-- | Makes a getter for a particular property name.
@@ -179,25 +183,37 @@ this !! index = do
179-- 11
183-- 11
180js :: (MakeObject s, MakeStringRef name)
184js :: (MakeObject s, MakeStringRef name)
181 => name -- ^ Name of the property to find
185 => name -- ^ Name of the property to find
182− -> IndexPreservingGetter s (JSM JSPropRef)
186+ -> IndexPreservingGetter s (JSM JSValueRef)
183js name = to (!name)
187js name = to (!name)
184{-# INLINE js #-}
188{-# INLINE js #-}
185
189
186−-- | Java script function applications have this type
190+-- | Makes a setter for a particular property name.
191+--
192+-- > jss name = to (<#name)
193+--
194+-- >>> testJSaddle $ eval "'Hello World'.length"
195+-- >>> testJSaddle $ val "Hello World" ^. js "length"
196+-- 11
197+jss :: (MakeStringRef name, MakeValueRef val)
198+ => name -- ^ Name of the property to find
199+ -> val
187−type JSF = forall o . MakeObject o => IndexPreservingGetter o (JSM JSValueRef)
200+ -> forall o . MakeObject o => IndexPreservingGetter o (JSM ())
201+jss name val = to (\o -> o <# name $ val)
202+{-# INLINE jss #-}
188
203
189-- | Handy way to call a function
204-- | Handy way to call a function
190--
205--
191−-- > jsf name = js name . to (# args)
206+-- > jsf name = to (\o -> o # name $ args)
192--
207--
193-- >>> testJSaddle $ val "Hello World" ^. jsf "indexOf" ["World"]
208-- >>> testJSaddle $ val "Hello World" ^. jsf "indexOf" ["World"]
194-- 6
209-- 6
195jsf :: (MakeStringRef name, MakeArgRefs args) => name -> args -> JSF
210jsf :: (MakeStringRef name, MakeArgRefs args) => name -> args -> JSF
196−jsf name args = function . to (# args)
211+jsf name args = to (\o -> o # name $ args)
197− where
198− function = js name
199{-# INLINE jsf #-}
212{-# INLINE jsf #-}
200
213
214+-- | Java script function applications have this type
215+type JSF = forall o . MakeObject o => IndexPreservingGetter o (JSM JSValueRef)
216+
201-- | Handy way to call a function that expects no arguments
217-- | Handy way to call a function that expects no arguments
202--
218--
203-- > js0 name = jsf name ()
219-- > js0 name = jsf name ()
@@ -249,41 +265,126 @@ js5 name a0 a1 a2 a3 a4 = jsf name (a0, a1, a2, a3, a4)
249-- >>> testJSaddle $ eval "w = console; w.log('Hello World')"
265-- >>> testJSaddle $ eval "w = console; w.log('Hello World')"
250-- >>> testJSaddle $ do w <- jsg "console"; w ^. js "log" # ["Hello World"]
266-- >>> testJSaddle $ do w <- jsg "console"; w ^. js "log" # ["Hello World"]
251-- 11
267-- 11
252−jsg :: MakeStringRef a => a -> JSM JSPropRef
268+jsg :: MakeStringRef a => a -> JSM JSValueRef
253jsg name = global ! name
269jsg name = global ! name
254{-# INLINE jsg #-}
270{-# INLINE jsg #-}
255
271
272+-- | Handy way to call a function
273+--
274+-- > jsgf name = jsg name . to (# args)
275+--
276+-- >>> testJSaddle $ jsf "globalFunc" ["World"]
277+-- 6
278+jsgf :: (MakeStringRef name, MakeArgRefs args) => name -> args -> JSM JSValueRef
279+jsgf name = global # name
280+{-# INLINE jsgf #-}
281+
282+-- | Handy way to call a function that expects no arguments
283+--
284+-- > jsg0 name = jsgf name ()
285+--
286+-- >>> testJSaddle $ js0 "globalFunc"
287+-- hello world
288+jsg0 :: (MakeStringRef name) => name -> JSM JSValueRef
289+jsg0 name = jsgf name ()
290+{-# INLINE jsg0 #-}
291+
292+-- | Handy way to call a function that expects one argument
293+--
294+-- > jsg1 name a0 = jsgf name [a0]
295+--
296+-- >>> testJSaddle $ jsg1 "globalFunc" "World"
297+-- 6
298+jsg1 :: (MakeStringRef name, MakeValueRef a0) => name -> a0 -> JSM JSValueRef
299+jsg1 name a0 = jsgf name [a0]
300+{-# INLINE jsg1 #-}
301+
302+-- | Handy way to call a function that expects two arguments
303+jsg2 :: (MakeStringRef name, MakeValueRef a0, MakeValueRef a1) => name -> a0 -> a1 -> JSM JSValueRef
304+jsg2 name a0 a1 = jsgf name (a0, a1)
305+{-# INLINE jsg2 #-}
306+
307+-- | Handy way to call a function that expects three arguments
308+jsg3 :: (MakeStringRef name, MakeValueRef a0, MakeValueRef a1, MakeValueRef a2)
309+ => name -> a0 -> a1 -> a2 -> JSM JSValueRef
310+jsg3 name a0 a1 a2 = jsgf name (a0, a1, a2)
311+{-# INLINE jsg3 #-}
312+
313+-- | Handy way to call a function that expects four arguments
314+jsg4 :: (MakeStringRef name, MakeValueRef a0, MakeValueRef a1, MakeValueRef a2,
315+ MakeValueRef a3)
316+ => name -> a0 -> a1 -> a2 -> a3 -> JSM JSValueRef
317+jsg4 name a0 a1 a2 a3 = jsgf name (a0, a1, a2, a3)
318+{-# INLINE jsg4 #-}
319+
320+-- | Handy way to call a function that expects five arguments
321+jsg5 :: (MakeStringRef name, MakeValueRef a0, MakeValueRef a1, MakeValueRef a2,
322+ MakeValueRef a3, MakeValueRef a4)
323+ => name -> a0 -> a1 -> a2 -> a3 -> a4 -> JSM JSValueRef
324+jsg5 name a0 a1 a2 a3 a4 = jsgf name (a0, a1, a2, a3, a4)
325+{-# INLINE jsg5 #-}
326+
256-- | Call a JavaScript function
327-- | Call a JavaScript function
257--
328--
258-- >>> testJSaddle $ eval "'Hello World'.indexOf('World')"
329-- >>> testJSaddle $ eval "'Hello World'.indexOf('World')"
259−-- >>> testJSaddle $ val "Hello World" ! "indexOf" # ["World"]
330+-- >>> testJSaddle $ val "Hello World" # "indexOf" $ ["World"]
260-- 6
331-- 6
261infixr 2 #
332infixr 2 #
262−(#) :: (MakePropRef prop, MakeArgRefs args)
333+(#) :: (MakeObject this, MakeStringRef name, MakeArgRefs args)
263− => prop -> args -> JSM JSValueRef
334+ => this -> name -> args -> JSM JSValueRef
264−prop # args = do
335+(#) this name args = do
265− rprop <- makePropRef prop
336+ rthis <- makeObject this
266− (this, f) <- objGetProperty' rprop
337+ f <- rethrow $ objGetPropertyByName rthis name
267 f' <- valToObject f
338 f' <- valToObject f
268− rethrow $ objCallAsFunction f' this args
339+ rethrow $ objCallAsFunction f' rthis args
269{-# INLINE (#) #-}
340{-# INLINE (#) #-}
270
341
271-- | Call a JavaScript function
342-- | Call a JavaScript function
272--
343--
344+-- >>> testJSaddle $ eval "something[6]('World')"
345+-- >>> testJSaddle $ val something ## 6 ["World"]
346+infixr 2 ##
347+(##) :: (MakeObject this, MakeArgRefs args)
348+ => this -> Index -> args -> JSM JSValueRef
349+(##) this index args = do
350+ rthis <- makeObject this
351+ f <- rethrow $ objGetPropertyAtIndex rthis index
352+ f' <- valToObject f
353+ rethrow $ objCallAsFunction f' rthis args
354+{-# INLINE (##) #-}
355+
356+-- | Set a JavaScript property
357+--
273-- >>> testJSaddle $ eval "var j = {}; j.x = 1; j.x"
358-- >>> testJSaddle $ eval "var j = {}; j.x = 1; j.x"
274−-- >>> testJSaddle $ do {j <- eval "({})"; j!"x" <# 1; j!"x"}
359+-- >>> testJSaddle $ do {j <- eval "({})"; j <# "x" 1; j!"x"}
275-- 1
360-- 1
276−infixr 0 <#
361+infixr 1 <#
277−(<#) :: (MakePropRef prop, MakeValueRef val)
362+(<#) :: (MakeObject this, MakeStringRef name, MakeValueRef val)
278− => prop -- ^ Property to set
363+ => this -- ^ Object to set the property on
364+ -> name -- ^ Name of the property to set
279− -> val -- ^ Value to set it to
365+ -> val -- ^ Value to set it to
280− -> JSM JSPropRef -- ^ Reference to the property set
366+ -> JSM ()
281−prop <# val = do
367+(<#) this name val = do
282− p <- makePropRef prop
368+ rthis <- makeObject this
283− objSetProperty p val
369+ rethrow $ objSetPropertyByName rthis name val 0
284− return p
285{-# INLINE (<#) #-}
370{-# INLINE (<#) #-}
286
371
372+-- | Set a JavaScript property
373+--
374+-- >>> testJSaddle $ eval "var j = {}; j[6] = 1; j[6]"
375+-- >>> testJSaddle $ do {j <- eval "({})"; j <## 6 1; j!!6}
376+-- 1
377+infixr 1 <##
378+(<##) :: (MakeObject this, MakeValueRef val)
379+ => this -- ^ Object to set the property on
380+ -> Index -- ^ Index of the property to set
381+ -> val -- ^ Value to set it to
382+ -> JSM ()
383+(<##) this index val = do
384+ rthis <- makeObject this
385+ rethrow $ objSetPropertyAtIndex rthis index val
386+{-# INLINE (<##) #-}
387+
287-- | Use this to create a new JavaScript object
388-- | Use this to create a new JavaScript object
288--
389--
289-- If you pass more than 7 arguments to a constructor for a built in
390-- If you pass more than 7 arguments to a constructor for a built in
@@ -488,7 +589,7 @@ propertyNames = undefined
488#endif
589#endif
489
590
490-- | Get a list containing references to all the properties present on a given object
591-- | Get a list containing references to all the properties present on a given object
491−properties :: MakeObject this => this -> JSM [JSPropRef]
592+properties :: MakeObject this => this -> JSM [JSValueRef]
492properties this = propertyNames this >>= mapM (this !)
593properties this = propertyNames this >>= mapM (this !)
493
594
494-- | Call a JavaScript object as function. Consider using '#'.
595-- | Call a JavaScript object as function. Consider using '#'.
src/Language/Javascript/JSaddle/PropRef.hsdeleted−25
@@ -1,25 +0,0 @@
1−-----------------------------------------------------------------------------
2−--
3−-- Module : Language.Javascript.JSaddle.PropRef
4−-- Copyright : (c) Hamish Mackenzie
5−-- License : MIT
6−--
7−-- Maintainer : Hamish Mackenzie <Hamish.K.Mackenzie@googlemail.com>
8−--
9−-- | Implements a reference to a property
10−--
11−-----------------------------------------------------------------------------
12−
13−module Language.Javascript.JSaddle.PropRef (
14− JSPropRef(..)
15−) where
16−
17−import Language.Javascript.JSaddle.Types
18− (JSStringRef, Object, Index)
19−
20−-- | A reference to a property.
21−-- Implemented as a reference to an object and something to find the property.
22−data JSPropRef = JSPropRef Object JSStringRef -- ^ Object and property name.
23− | JSPropIndexRef Object Index -- ^ Object and property index.
24−
25−
src/Language/Javascript/JSaddle/Properties.hs+2−72
@@ -21,25 +21,17 @@
21-----------------------------------------------------------------------------
21-----------------------------------------------------------------------------
22
22
23module Language.Javascript.JSaddle.Properties (
23module Language.Javascript.JSaddle.Properties (
24− -- * Propery Reference
25− JSPropRef(..)
26− , MakePropRef(..)
27−
28 -- * Getting Property Values
24 -- * Getting Property Values
29− , objGetPropertyByName
25+ objGetPropertyByName
30 , objGetPropertyAtIndex
26 , objGetPropertyAtIndex
31− , objGetProperty
32− , objGetProperty'
33 -- * Setting Property Values
27 -- * Setting Property Values
34 , objSetPropertyByName
28 , objSetPropertyByName
35 , objSetPropertyAtIndex
29 , objSetPropertyAtIndex
36− , objSetProperty
37) where
30) where
38
31
39import Control.Applicative ((<$>))
32import Control.Applicative ((<$>))
40−import Language.Javascript.JSaddle.PropRef (JSPropRef(..))
41import Language.Javascript.JSaddle.Classes
33import Language.Javascript.JSaddle.Classes
42− (MakePropRef(..), MakeObject(..), MakeValueRef(..),
34+ (MakeObject(..), MakeValueRef(..),
43 MakeArgRefs(..), MakeStringRef(..))
35 MakeArgRefs(..), MakeStringRef(..))
44import Language.Javascript.JSaddle.Monad (JSM)
36import Language.Javascript.JSaddle.Monad (JSM)
45import Language.Javascript.JSaddle.Types
37import Language.Javascript.JSaddle.Types
@@ -59,34 +51,6 @@ import Language.Javascript.JSaddle.Value (JSValueRef)
59import Language.Javascript.JSaddle.Arguments ()
51import Language.Javascript.JSaddle.Arguments ()
60import Language.Javascript.JSaddle.String ()
52import Language.Javascript.JSaddle.String ()
61
53
62−-- | If we already have a JSPropRef we are fine
63−instance MakePropRef JSPropRef where
64− makePropRef = return
65− {-# INLINE makePropRef #-}
66−
67−-- | JSPropRef can be made by evaluating a function in 'JSM' as long
68−-- as it returns something we can make into a JSPropRef.
69−instance MakePropRef prop => MakePropRef (JSM prop) where
70− makePropRef prop = prop >>= makePropRef
71− {-# INLINE makePropRef #-}
72−
73−-- | We can use a property as an object.
74−instance MakeObject JSPropRef where
75− makeObject prop = Object <$> objGetProperty prop
76− {-# INLINE makeObject #-}
77−
78−-- | We can use a property as a value.
79−instance MakeValueRef JSPropRef where
80− makeValueRef = objGetProperty
81− {-# INLINE makeValueRef #-}
82−
83−-- | We can pass a property as the only paramter to a function.
84−instance MakeArgRefs JSPropRef where
85− makeArgRefs p = do
86− rarg <- objGetProperty p
87− return [rarg]
88− {-# INLINE makeArgRefs #-}
89−
90-- | Get a property value given the object and the name of the property.
54-- | Get a property value given the object and the name of the property.
91objGetPropertyByName :: MakeStringRef name
55objGetPropertyByName :: MakeStringRef name
92 => Object -- ^ object to find the property on.
56 => Object -- ^ object to find the property on.
@@ -126,27 +90,6 @@ objGetPropertyAtIndex (Object this) index exceptions = do
126objGetPropertyAtIndex = undefined
90objGetPropertyAtIndex = undefined
127#endif
91#endif
128
92
129−-- | Gets the value of a property given a 'JSPropRef'.
130−objGetProperty :: JSPropRef -- ^ property reference.
131− -> JSM JSValueRef -- ^ returns the property value.
132−objGetProperty (JSPropRef this name ) =
133− rethrow $ objGetPropertyByName this name
134−objGetProperty (JSPropIndexRef this index) =
135− rethrow $ objGetPropertyAtIndex this index
136−{-# INLINE objGetProperty #-}
137−
138−-- | This version of 'objGetProperty' is handy when you also need to perform.
139−-- another operation on the object the property is on.
140−objGetProperty' :: JSPropRef -- ^ property reference.
141− -> JSM (Object, JSValueRef) -- ^ returns the object and property value.
142−objGetProperty' (JSPropRef this name) = do
143− p <- rethrow $ objGetPropertyByName this name
144− return (this, p)
145−objGetProperty' (JSPropIndexRef this index) = do
146− p <- rethrow $ objGetPropertyAtIndex this index
147− return (this, p)
148−{-# INLINE objGetProperty' #-}
149−
150-- | Set a property value given the object and the name of the property.
93-- | Set a property value given the object and the name of the property.
151objSetPropertyByName :: (MakeStringRef name, MakeValueRef val)
94objSetPropertyByName :: (MakeStringRef name, MakeValueRef val)
152 => Object -- ^ object to set the property on.
95 => Object -- ^ object to set the property on.
@@ -196,16 +139,3 @@ objSetPropertyAtIndex (Object this) index val exceptions = do
196objSetPropertyAtIndex = undefined
139objSetPropertyAtIndex = undefined
197#endif
140#endif
198
141
199−-- | Sets the value of a property given a 'JSPropRef'.
200−objSetProperty :: (MakeValueRef val)
201− => JSPropRef -- ^ property reference.
202− -> val -- ^ new value to set the property to.
203− -> JSM ()
204−objSetProperty (JSPropRef this name ) val = rethrow $ objSetPropertyByName this name val 0
205−objSetProperty (JSPropIndexRef this index) val = rethrow $ objSetPropertyAtIndex this index val
206−{-# INLINE objSetProperty #-}
207−
208−
209−
210−
211−
src/Language/Javascript/JSaddle/Value.hs+4
@@ -304,6 +304,10 @@ valToObject val = Object <$>
304#endif
304#endif
305{-# INLINE valToObject #-}
305{-# INLINE valToObject #-}
306
306
307+instance MakeObject JSValueRef where
308+ makeObject = valToObject
309+ {-# INLINE makeObject #-}
310+
307-- | Convert to a JavaScript value (just an alias for 'makeValueRef')
311-- | Convert to a JavaScript value (just an alias for 'makeValueRef')
308val :: MakeValueRef value
312val :: MakeValueRef value
309 => value -- ^ value to convert to a JavaScript value
313 => value -- ^ value to convert to a JavaScript value