@@ -155,7 +155,6 @@ import Data.Text (Text)
155155-- as it returns something we can make into a Object.
156156instance MakeObject v => MakeObject (JSM v) where
157157 makeObject v = v >>= makeObject
158− {-# INLINE makeObject #-}
159158
160159-- | Lookup a property based on its name.
161160--
@@ -172,7 +171,6 @@ this ! name = do
172171 rethrow $ objGetPropertyByName rthis rname
173172 where
174173 rname = toJSString name
175−{-# INLINE (!) #-}
176174
177175-- | Lookup a property based on its index.
178176--
@@ -187,7 +185,6 @@ this ! name = do
187185this !! index = do
188186 rthis <- makeObject this
189187 rethrow $ objGetPropertyAtIndex rthis index
190−{-# INLINE (!!) #-}
191188
192189-- | Makes a getter for a particular property name.
193190--
@@ -201,7 +198,6 @@ js :: (MakeObject s, ToJSString name)
201198 => name -- ^ Name of the property to find
202199 -> IndexPreservingGetter s (JSM JSVal)
203200js name = to (!name)
204−{-# INLINE js #-}
205201
206202-- | Makes a setter for a particular property name.
207203--
@@ -216,7 +212,6 @@ jss :: (ToJSString name, ToJSVal val)
216212 -> val
217213 -> forall o . MakeObject o => IndexPreservingGetter o (JSM ())
218214jss name val = to (\o -> o <# name $ val)
219−{-# INLINE jss #-}
220215
221216-- | Handy way to call a function
222217--
@@ -226,7 +221,6 @@ jss name val = to (\o -> o <# name $ val)
226221-- 6
227222jsf :: (ToJSString name, MakeArgs args) => name -> args -> JSF
228223jsf name args = to (\o -> o # name $ args)
229−{-# INLINE jsf #-}
230224
231225-- | Java script function applications have this type
232226type JSF = forall o . MakeObject o => IndexPreservingGetter o (JSM JSVal)
@@ -239,7 +233,6 @@ type JSF = forall o . MakeObject o => IndexPreservingGetter o (JSM JSVal)
239233-- hello world
240234js0 :: (ToJSString name) => name -> JSF
241235js0 name = jsf name ()
242−{-# INLINE js0 #-}
243236
244237-- | Handy way to call a function that expects one argument
245238--
@@ -249,32 +242,27 @@ js0 name = jsf name ()
249242-- 6
250243js1 :: (ToJSString name, ToJSVal a0) => name -> a0 -> JSF
251244js1 name a0 = jsf name [a0]
252−{-# INLINE js1 #-}
253245
254246-- | Handy way to call a function that expects two arguments
255247js2 :: (ToJSString name, ToJSVal a0, ToJSVal a1) => name -> a0 -> a1 -> JSF
256248js2 name a0 a1 = jsf name (a0, a1)
257−{-# INLINE js2 #-}
258249
259250-- | Handy way to call a function that expects three arguments
260251js3 :: (ToJSString name, ToJSVal a0, ToJSVal a1, ToJSVal a2)
261252 => name -> a0 -> a1 -> a2 -> JSF
262253js3 name a0 a1 a2 = jsf name (a0, a1, a2)
263−{-# INLINE js3 #-}
264254
265255-- | Handy way to call a function that expects four arguments
266256js4 :: (ToJSString name, ToJSVal a0, ToJSVal a1, ToJSVal a2,
267257 ToJSVal a3)
268258 => name -> a0 -> a1 -> a2 -> a3 -> JSF
269259js4 name a0 a1 a2 a3 = jsf name (a0, a1, a2, a3)
270−{-# INLINE js4 #-}
271260
272261-- | Handy way to call a function that expects five arguments
273262js5 :: (ToJSString name, ToJSVal a0, ToJSVal a1, ToJSVal a2,
274263 ToJSVal a3, ToJSVal a4)
275264 => name -> a0 -> a1 -> a2 -> a3 -> a4 -> JSF
276265js5 name a0 a1 a2 a3 a4 = jsf name (a0, a1, a2, a3, a4)
277−{-# INLINE js5 #-}
278266
279267
280268-- | Handy way to get and hold onto a reference top level javascript
@@ -289,7 +277,6 @@ js5 name a0 a1 a2 a3 a4 = jsf name (a0, a1, a2, a3, a4)
289277-- undefined
290278jsg :: ToJSString a => a -> JSM JSVal
291279jsg name = global ! name
292−{-# INLINE jsg #-}
293280
294281-- | Handy way to call a function
295282--
@@ -301,7 +288,6 @@ jsg name = global ! name
301288-- 5
302289jsgf :: (ToJSString name, MakeArgs args) => name -> args -> JSM JSVal
303290jsgf name = global # name
304−{-# INLINE jsgf #-}
305291
306292-- | Handy way to call a function that expects no arguments
307293--
@@ -311,7 +297,6 @@ jsgf name = global # name
311297-- TypeError:...undefined...is not an objec...
312298jsg0 :: (ToJSString name) => name -> JSM JSVal
313299jsg0 name = jsgf name ()
314−{-# INLINE jsg0 #-}
315300
316301-- | Handy way to call a function that expects one argument
317302--
@@ -321,32 +306,27 @@ jsg0 name = jsgf name ()
321306-- 5
322307jsg1 :: (ToJSString name, ToJSVal a0) => name -> a0 -> JSM JSVal
323308jsg1 name a0 = jsgf name [a0]
324−{-# INLINE jsg1 #-}
325309
326310-- | Handy way to call a function that expects two arguments
327311jsg2 :: (ToJSString name, ToJSVal a0, ToJSVal a1) => name -> a0 -> a1 -> JSM JSVal
328312jsg2 name a0 a1 = jsgf name (a0, a1)
329−{-# INLINE jsg2 #-}
330313
331314-- | Handy way to call a function that expects three arguments
332315jsg3 :: (ToJSString name, ToJSVal a0, ToJSVal a1, ToJSVal a2)
333316 => name -> a0 -> a1 -> a2 -> JSM JSVal
334317jsg3 name a0 a1 a2 = jsgf name (a0, a1, a2)
335−{-# INLINE jsg3 #-}
336318
337319-- | Handy way to call a function that expects four arguments
338320jsg4 :: (ToJSString name, ToJSVal a0, ToJSVal a1, ToJSVal a2,
339321 ToJSVal a3)
340322 => name -> a0 -> a1 -> a2 -> a3 -> JSM JSVal
341323jsg4 name a0 a1 a2 a3 = jsgf name (a0, a1, a2, a3)
342−{-# INLINE jsg4 #-}
343324
344325-- | Handy way to call a function that expects five arguments
345326jsg5 :: (ToJSString name, ToJSVal a0, ToJSVal a1, ToJSVal a2,
346327 ToJSVal a3, ToJSVal a4)
347328 => name -> a0 -> a1 -> a2 -> a3 -> a4 -> JSM JSVal
348329jsg5 name a0 a1 a2 a3 a4 = jsgf name (a0, a1, a2, a3, a4)
349−{-# INLINE jsg5 #-}
350330
351331-- | Call a JavaScript function
352332--
@@ -362,7 +342,6 @@ infixr 2 #
362342 f <- rethrow $ objGetPropertyByName rthis name
363343 f' <- valToObject f
364344 rethrow $ objCallAsFunction f' rthis args
365−{-# INLINE (#) #-}
366345
367346-- | Call a JavaScript function
368347--
@@ -378,7 +357,6 @@ infixr 2 ##
378357 f <- rethrow $ objGetPropertyAtIndex rthis index
379358 f' <- valToObject f
380359 rethrow $ objCallAsFunction f' rthis args
381−{-# INLINE (##) #-}
382360
383361-- | Set a JavaScript property
384362--
@@ -395,7 +373,6 @@ infixr 1 <#
395373(<#) this name val = do
396374 rthis <- makeObject this
397375 rethrow $ objSetPropertyByName rthis name val 0
398−{-# INLINE (<#) #-}
399376
400377-- | Set a JavaScript property
401378--
@@ -412,7 +389,6 @@ infixr 1 <##
412389(<##) this index val = do
413390 rthis <- makeObject this
414391 rethrow $ objSetPropertyAtIndex rthis index val
415−{-# INLINE (<##) #-}
416392
417393-- | Use this to create a new JavaScript object
418394--
@@ -428,7 +404,6 @@ new :: (MakeObject constructor, MakeArgs args)
428404new constructor args = do
429405 f <- makeObject constructor
430406 rethrow $ objCallAsConstructor f args
431−{-# INLINE new #-}
432407
433408-- | Call function with a given @this@. In most cases you should use '#'.
434409--
@@ -442,7 +417,6 @@ call f this args = do
442417 rfunction <- makeObject f
443418 rthis <- makeObject this
444419 rethrow $ objCallAsFunction rfunction rthis args
445−{-# INLINE call #-}
446420
447421-- | Make an empty object using the default constuctor
448422--
@@ -458,7 +432,6 @@ obj = do
458432 gctxt <- ask
459433 Object <$> (liftIO (jsobjectmake gctxt nullPtr nullPtr) >>= makeNewJSVal)
460434#endif
461−{-# INLINE obj #-}
462435
463436-- | Type used for Haskell functions called from JavaScript.
464437type JSCallAsFunction = JSVal -- ^ Function object
@@ -482,7 +455,6 @@ type JSCallAsFunction = JSVal -- ^ Function object
482455-- undefined
483456fun :: JSCallAsFunction -> JSCallAsFunction
484457fun = id
485−{-# INLINE fun #-}
486458
487459#ifdef ghcjs_HOST_OS
488460type HaskellCallback = Callback (JSVal -> JSVal -> IO ())
@@ -538,20 +510,17 @@ freeFunction (Function callback _) = liftIO $
538510
539511instance ToJSVal Function where
540512 toJSVal (Function _ f) = toJSVal f
541− {-# INLINE toJSVal #-}
542513
543514-- | A callback to Haskell can be used as a JavaScript value. This will create
544515-- an anonymous JavaScript function object. Use 'function' to create one with
545516-- a name.
546517instance ToJSVal JSCallAsFunction where
547518 toJSVal f = functionObject <$> function nullJSString f >>= toJSVal
548− {-# INLINE toJSVal #-}
549519
550520instance MakeArgs JSCallAsFunction where
551521 makeArgs f = do
552522 rarg <- functionObject <$> function nullJSString f >>= toJSVal
553523 return [rarg]
554− {-# INLINE makeArgs #-}
555524
556525makeArray :: MakeArgs args => args -> MutableJSArray -> JSM Object
557526#ifdef ghcjs_HOST_OS
@@ -568,7 +537,6 @@ makeArray args exceptions = do
568537 jsobjectmakearray gctxt (fromIntegral len) ptr exceptions
569538 Object <$> makeNewJSVal result
570539#endif
571−{-# INLINE makeArray #-}
572540
573541-- | Make an JavaScript array from a list of values
574542--
@@ -586,45 +554,35 @@ array = rethrow . makeArray
586554-- Make an array out of various lists
587555instance ToJSVal [JSVal] where
588556 toJSVal = toJSVal . array
589− {-# INLINE toJSVal #-}
590557
591558instance ToJSVal [JSM JSVal] where
592559 toJSVal = toJSVal . array
593− {-# INLINE toJSVal #-}
594560
595561instance ToJSVal [Double] where
596562 toJSVal = toJSVal . array
597− {-# INLINE toJSVal #-}
598563
599564instance ToJSVal [Float] where
600565 toJSVal = toJSVal . array
601− {-# INLINE toJSVal #-}
602566
603567instance ToJSVal [Int] where
604568 toJSVal = toJSVal . array
605− {-# INLINE toJSVal #-}
606569
607570instance ToJSVal [JSString] where
608571 toJSVal = toJSVal . array
609− {-# INLINE toJSVal #-}
610572
611573instance ToJSVal [String] where
612574 toJSVal = toJSVal . array
613− {-# INLINE toJSVal #-}
614575
615576instance ToJSVal [Text] where
616577 toJSVal = toJSVal . array
617− {-# INLINE toJSVal #-}
618578
619579instance ToJSVal [Bool] where
620580 toJSVal = toJSVal . array
621− {-# INLINE toJSVal #-}
622581
623582-- | JavaScript's global object
624583global :: JSM Object
625584#ifdef ghcjs_HOST_OS
626585global = liftIO js_window
627−{-# INLINE global #-}
628586foreign import javascript unsafe "$r = window"
629587 js_window :: IO Object
630588#else
@@ -632,7 +590,6 @@ global = do
632590 gctxt <- ask
633591 result <- liftIO $ jscontextgetglobalobject gctxt
634592 Object <$> makeNewJSVal result
635−{-# INLINE global #-}
636593#endif
637594
638595-- | Get an array containing the property names present on a given object
@@ -643,36 +600,30 @@ copyPropertyNames this = do
643600 this' <- makeObject this
644601 withObject this' $ \rthis ->
645602 liftIO $ jsobjectcopypropertynames gctxt rthis
646−{-# INLINE copyPropertyNames #-}
647603
648604-- | Get the number of names in a property name array
649605propertyNamesCount :: MonadIO m => JSPropertyNameArray -> m CSize
650606propertyNamesCount names = liftIO $ jspropertynamearraygetcount names
651−{-# INLINE propertyNamesCount #-}
652607
653608-- | Get a name out of a property name array
654609propertyNamesAt :: MonadIO m => JSPropertyNameArray -> CSize -> m JSString
655610propertyNamesAt names index = liftIO $ jspropertynamearraygetnameatindex names index >>= makeNewJSString
656−{-# INLINE propertyNamesAt #-}
657611
658612-- | Convert property array to a list
659613propertyNamesList :: MonadIO m => JSPropertyNameArray -> m [JSString]
660614propertyNamesList names = do
661615 count <- propertyNamesCount names
662616 mapM (propertyNamesAt names) $ enumFromTo 0 (count - 1)
663−{-# INLINE propertyNamesList #-}
664617#endif
665618
666619-- | Get a list containing the property names present on a given object
667620propertyNames :: MakeObject this => this -> JSM [JSString]
668621#ifdef ghcjs_HOST_OS
669622propertyNames this = makeObject this >>= liftIO . js_propertyNames >>= liftIO . (fmap (map pFromJSVal)) . Array.toListIO
670−{-# INLINE propertyNames #-}
671623foreign import javascript unsafe "$r = []; h$forIn($1, function(n){$r.push(n);})"
672624 js_propertyNames :: Object -> IO JSArray
673625#else
674626propertyNames this = copyPropertyNames this >>= propertyNamesList
675−{-# INLINE propertyNames #-}
676627#endif
677628
678629-- | Get a list containing references to all the properties present on a given object
@@ -690,7 +641,6 @@ objCallAsFunction :: MakeArgs args
690641objCallAsFunction f this args exceptions = do
691642 rargs <- makeArgs args >>= liftIO . Array.fromListIO
692643 liftIO $ js_apply f this rargs exceptions
693−{-# INLINE objCallAsFunction #-}
694644foreign import javascript unsafe "try { $r = $1.apply($2, $3) } catch(e) { $4[0] = e }"
695645 js_apply :: Object -> Object -> MutableJSArray -> MutableJSArray -> IO JSVal
696646#else
@@ -704,7 +654,6 @@ objCallAsFunction f this args exceptions = do
704654 liftIO $ withArrayLen rargs' $ \ largs pargs ->
705655 jsobjectcallasfunction gctxt rfunction rthis (fromIntegral largs) pargs exceptions
706656 makeNewJSVal result
707−{-# INLINE objCallAsFunction #-}
708657#endif
709658
710659-- | Call a JavaScript object as a constructor. Consider using 'new'.