@@ -86,8 +86,8 @@ module Language.Javascript.JSaddle.Object (
8686
8787import Prelude hiding ((!!))
8888import Language.Javascript.JSaddle.Types
89− (JSPropertyNameArrayRef, JSStringRef, Object(..), JSValueRefRef,
90− JSValueRef, JSContextRef, Index)
89+ (JSPropertyNameArray, JSString, Object(..), MutableJSArray,
90+ JSVal, Index)
9191import Foreign.C.Types (CSize(..), CULong(..), CUInt(..), CULLong(..))
9292#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
9393import GHCJS.Types (nullRef, jsval)
@@ -119,7 +119,7 @@ import Language.Javascript.JSaddle.Exception (rethrow)
119119import Language.Javascript.JSaddle.Value
120120 (JSUndefined, valMakeUndefined, valToObject)
121121import Language.Javascript.JSaddle.Classes
122− (MakeValueRef(..), MakeStringRef(..), MakeArgRefs(..), MakeObject(..))
122+ (MakeVal(..), MakeString(..), MakeArgs(..), MakeObject(..))
123123import Language.Javascript.JSaddle.Monad
124124 (JSM)
125125import Control.Monad.Trans.Reader (runReaderT, ask)
@@ -149,15 +149,15 @@ instance MakeObject v => MakeObject (JSM v) where
149149-- >>> testJSaddle $ eval "'Hello World'.length"
150150-- >>> testJSaddle $ val "Hello World" ! "length"
151151-- 11
152−(!) :: (MakeObject this, MakeStringRef name)
152+(!) :: (MakeObject this, MakeString name)
153153 => this -- ^ Object to look on
154154 -> name -- ^ Name of the property to find
155− -> JSM JSValueRef -- ^ Property reference
155+ -> JSM JSVal -- ^ Property reference
156156this ! name = do
157157 rthis <- makeObject this
158158 rethrow $ objGetPropertyByName rthis rname
159159 where
160− rname = makeStringRef name
160+ rname = makeString name
161161{-# INLINE (!) #-}
162162
163163-- | Lookup a property based on its index.
@@ -168,7 +168,7 @@ this ! name = do
168168(!!) :: (MakeObject this)
169169 => this -- ^ Object to look on
170170 -> Index -- ^ Index of the property to lookup
171− -> JSM JSValueRef -- ^ Property reference
171+ -> JSM JSVal -- ^ Property reference
172172this !! index = do
173173 rthis <- makeObject this
174174 rethrow $ objGetPropertyAtIndex rthis index
@@ -181,9 +181,9 @@ this !! index = do
181181-- >>> testJSaddle $ eval "'Hello World'.length"
182182-- >>> testJSaddle $ val "Hello World" ^. js "length"
183183-- 11
184−js :: (MakeObject s, MakeStringRef name)
184+js :: (MakeObject s, MakeString name)
185185 => name -- ^ Name of the property to find
186− -> IndexPreservingGetter s (JSM JSValueRef)
186+ -> IndexPreservingGetter s (JSM JSVal)
187187js name = to (!name)
188188{-# INLINE js #-}
189189
@@ -194,7 +194,7 @@ js name = to (!name)
194194-- >>> testJSaddle $ eval "'Hello World'.length"
195195-- >>> testJSaddle $ val "Hello World" ^. js "length"
196196-- 11
197−jss :: (MakeStringRef name, MakeValueRef val)
197+jss :: (MakeString name, MakeVal val)
198198 => name -- ^ Name of the property to find
199199 -> val
200200 -> forall o . MakeObject o => IndexPreservingGetter o (JSM ())
@@ -207,12 +207,12 @@ jss name val = to (\o -> o <# name $ val)
207207--
208208-- >>> testJSaddle $ val "Hello World" ^. jsf "indexOf" ["World"]
209209-- 6
210−jsf :: (MakeStringRef name, MakeArgRefs args) => name -> args -> JSF
210+jsf :: (MakeString name, MakeArgs args) => name -> args -> JSF
211211jsf name args = to (\o -> o # name $ args)
212212{-# INLINE jsf #-}
213213
214214-- | Java script function applications have this type
215−type JSF = forall o . MakeObject o => IndexPreservingGetter o (JSM JSValueRef)
215+type JSF = forall o . MakeObject o => IndexPreservingGetter o (JSM JSVal)
216216
217217-- | Handy way to call a function that expects no arguments
218218--
@@ -220,7 +220,7 @@ type JSF = forall o . MakeObject o => IndexPreservingGetter o (JSM JSValueRef)
220220--
221221-- >>> testJSaddle $ val "Hello World" ^. js0 "toLowerCase"
222222-- hello world
223−js0 :: (MakeStringRef name) => name -> JSF
223+js0 :: (MakeString name) => name -> JSF
224224js0 name = jsf name ()
225225{-# INLINE js0 #-}
226226
@@ -230,31 +230,31 @@ js0 name = jsf name ()
230230--
231231-- >>> testJSaddle $ val "Hello World" ^. js1 "indexOf" "World"
232232-- 6
233−js1 :: (MakeStringRef name, MakeValueRef a0) => name -> a0 -> JSF
233+js1 :: (MakeString name, MakeVal a0) => name -> a0 -> JSF
234234js1 name a0 = jsf name [a0]
235235{-# INLINE js1 #-}
236236
237237-- | Handy way to call a function that expects two arguments
238−js2 :: (MakeStringRef name, MakeValueRef a0, MakeValueRef a1) => name -> a0 -> a1 -> JSF
238+js2 :: (MakeString name, MakeVal a0, MakeVal a1) => name -> a0 -> a1 -> JSF
239239js2 name a0 a1 = jsf name (a0, a1)
240240{-# INLINE js2 #-}
241241
242242-- | Handy way to call a function that expects three arguments
243−js3 :: (MakeStringRef name, MakeValueRef a0, MakeValueRef a1, MakeValueRef a2)
243+js3 :: (MakeString name, MakeVal a0, MakeVal a1, MakeVal a2)
244244 => name -> a0 -> a1 -> a2 -> JSF
245245js3 name a0 a1 a2 = jsf name (a0, a1, a2)
246246{-# INLINE js3 #-}
247247
248248-- | Handy way to call a function that expects four arguments
249−js4 :: (MakeStringRef name, MakeValueRef a0, MakeValueRef a1, MakeValueRef a2,
250− MakeValueRef a3)
249+js4 :: (MakeString name, MakeVal a0, MakeVal a1, MakeVal a2,
250+ MakeVal a3)
251251 => name -> a0 -> a1 -> a2 -> a3 -> JSF
252252js4 name a0 a1 a2 a3 = jsf name (a0, a1, a2, a3)
253253{-# INLINE js4 #-}
254254
255255-- | Handy way to call a function that expects five arguments
256−js5 :: (MakeStringRef name, MakeValueRef a0, MakeValueRef a1, MakeValueRef a2,
257− MakeValueRef a3, MakeValueRef a4)
256+js5 :: (MakeString name, MakeVal a0, MakeVal a1, MakeVal a2,
257+ MakeVal a3, MakeVal a4)
258258 => name -> a0 -> a1 -> a2 -> a3 -> a4 -> JSF
259259js5 name a0 a1 a2 a3 a4 = jsf name (a0, a1, a2, a3, a4)
260260{-# INLINE js5 #-}
@@ -265,7 +265,7 @@ js5 name a0 a1 a2 a3 a4 = jsf name (a0, a1, a2, a3, a4)
265265-- >>> testJSaddle $ eval "w = console; w.log('Hello World')"
266266-- >>> testJSaddle $ do w <- jsg "console"; w ^. js "log" # ["Hello World"]
267267-- 11
268−jsg :: MakeStringRef a => a -> JSM JSValueRef
268+jsg :: MakeString a => a -> JSM JSVal
269269jsg name = global ! name
270270{-# INLINE jsg #-}
271271
@@ -275,7 +275,7 @@ jsg name = global ! name
275275--
276276-- >>> testJSaddle $ jsf "globalFunc" ["World"]
277277-- 6
278−jsgf :: (MakeStringRef name, MakeArgRefs args) => name -> args -> JSM JSValueRef
278+jsgf :: (MakeString name, MakeArgs args) => name -> args -> JSM JSVal
279279jsgf name = global # name
280280{-# INLINE jsgf #-}
281281
@@ -285,7 +285,7 @@ jsgf name = global # name
285285--
286286-- >>> testJSaddle $ js0 "globalFunc"
287287-- hello world
288−jsg0 :: (MakeStringRef name) => name -> JSM JSValueRef
288+jsg0 :: (MakeString name) => name -> JSM JSVal
289289jsg0 name = jsgf name ()
290290{-# INLINE jsg0 #-}
291291
@@ -295,32 +295,32 @@ jsg0 name = jsgf name ()
295295--
296296-- >>> testJSaddle $ jsg1 "globalFunc" "World"
297297-- 6
298−jsg1 :: (MakeStringRef name, MakeValueRef a0) => name -> a0 -> JSM JSValueRef
298+jsg1 :: (MakeString name, MakeVal a0) => name -> a0 -> JSM JSVal
299299jsg1 name a0 = jsgf name [a0]
300300{-# INLINE jsg1 #-}
301301
302302-- | Handy way to call a function that expects two arguments
303−jsg2 :: (MakeStringRef name, MakeValueRef a0, MakeValueRef a1) => name -> a0 -> a1 -> JSM JSValueRef
303+jsg2 :: (MakeString name, MakeVal a0, MakeVal a1) => name -> a0 -> a1 -> JSM JSVal
304304jsg2 name a0 a1 = jsgf name (a0, a1)
305305{-# INLINE jsg2 #-}
306306
307307-- | 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
308+jsg3 :: (MakeString name, MakeVal a0, MakeVal a1, MakeVal a2)
309+ => name -> a0 -> a1 -> a2 -> JSM JSVal
310310jsg3 name a0 a1 a2 = jsgf name (a0, a1, a2)
311311{-# INLINE jsg3 #-}
312312
313313-- | 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
314+jsg4 :: (MakeString name, MakeVal a0, MakeVal a1, MakeVal a2,
315+ MakeVal a3)
316+ => name -> a0 -> a1 -> a2 -> a3 -> JSM JSVal
317317jsg4 name a0 a1 a2 a3 = jsgf name (a0, a1, a2, a3)
318318{-# INLINE jsg4 #-}
319319
320320-- | 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
321+jsg5 :: (MakeString name, MakeVal a0, MakeVal a1, MakeVal a2,
322+ MakeVal a3, MakeVal a4)
323+ => name -> a0 -> a1 -> a2 -> a3 -> a4 -> JSM JSVal
324324jsg5 name a0 a1 a2 a3 a4 = jsgf name (a0, a1, a2, a3, a4)
325325{-# INLINE jsg5 #-}
326326
@@ -330,8 +330,8 @@ jsg5 name a0 a1 a2 a3 a4 = jsgf name (a0, a1, a2, a3, a4)
330330-- >>> testJSaddle $ val "Hello World" # "indexOf" $ ["World"]
331331-- 6
332332infixr 2 #
333−(#) :: (MakeObject this, MakeStringRef name, MakeArgRefs args)
334− => this -> name -> args -> JSM JSValueRef
333+(#) :: (MakeObject this, MakeString name, MakeArgs args)
334+ => this -> name -> args -> JSM JSVal
335335(#) this name args = do
336336 rthis <- makeObject this
337337 f <- rethrow $ objGetPropertyByName rthis name
@@ -344,8 +344,8 @@ infixr 2 #
344344-- >>> testJSaddle $ eval "something[6]('World')"
345345-- >>> testJSaddle $ val something ## 6 ["World"]
346346infixr 2 ##
347−(##) :: (MakeObject this, MakeArgRefs args)
348− => this -> Index -> args -> JSM JSValueRef
347+(##) :: (MakeObject this, MakeArgs args)
348+ => this -> Index -> args -> JSM JSVal
349349(##) this index args = do
350350 rthis <- makeObject this
351351 f <- rethrow $ objGetPropertyAtIndex rthis index
@@ -359,7 +359,7 @@ infixr 2 ##
359359-- >>> testJSaddle $ do {j <- eval "({})"; j <# "x" 1; j!"x"}
360360-- 1
361361infixr 1 <#
362−(<#) :: (MakeObject this, MakeStringRef name, MakeValueRef val)
362+(<#) :: (MakeObject this, MakeString name, MakeVal val)
363363 => this -- ^ Object to set the property on
364364 -> name -- ^ Name of the property to set
365365 -> val -- ^ Value to set it to
@@ -375,7 +375,7 @@ infixr 1 <#
375375-- >>> testJSaddle $ do {j <- eval "({})"; j <## 6 1; j!!6}
376376-- 1
377377infixr 1 <##
378−(<##) :: (MakeObject this, MakeValueRef val)
378+(<##) :: (MakeObject this, MakeVal val)
379379 => this -- ^ Object to set the property on
380380 -> Index -- ^ Index of the property to set
381381 -> val -- ^ Value to set it to
@@ -392,10 +392,10 @@ infixr 1 <##
392392--
393393-- >>> testJSaddle $ new "Date" (2013, 1, 1)
394394-- Fri Feb 01 2013 00:00:00 GMT+1300 (NZDT)
395−new :: (MakeObject constructor, MakeArgRefs args)
395+new :: (MakeObject constructor, MakeArgs args)
396396 => constructor
397397 -> args
398− -> JSM JSValueRef
398+ -> JSM JSVal
399399new constructor args = do
400400 f <- makeObject constructor
401401 rethrow $ objCallAsConstructor f args
@@ -406,8 +406,8 @@ new constructor args = do
406406-- >>> testJSaddle $ eval "(function(){return this;}).apply('Hello', [])"
407407-- >>> testJSaddle $ do { test <- eval "(function(){return this;})"; call test (val "Hello") () }
408408-- Hello
409−call :: (MakeObject function, MakeObject this, MakeArgRefs args)
410− => function -> this -> args -> JSM JSValueRef
409+call :: (MakeObject function, MakeObject this, MakeArgs args)
410+ => function -> this -> args -> JSM JSVal
411411call function this args = do
412412 rfunction <- makeObject function
413413 rthis <- makeObject this
@@ -430,9 +430,9 @@ obj = do
430430{-# INLINE obj #-}
431431
432432-- | Type used for Haskell functions called from JavaScript.
433−type JSCallAsFunction = JSValueRef -- ^ Function object
434− -> JSValueRef -- ^ this
435− -> [JSValueRef] -- ^ Function arguments
433+type JSCallAsFunction = JSVal -- ^ Function object
434+ -> JSVal -- ^ this
435+ -> [JSVal] -- ^ Function arguments
436436 -> JSM JSUndefined -- ^ Only 'JSUndefined' can be returned because
437437 -- the function may need to be executed in a
438438 -- different thread. If you need to get a
@@ -456,7 +456,7 @@ foreign import ccall "wrapper"
456456#endif
457457
458458-- ^ Make a JavaScript function object that wraps a Haskell function.
459−function :: MakeStringRef name
459+function :: MakeString name
460460 => name -- ^ Name of the function
461461 -> JSCallAsFunction -- ^ Haskell function to call
462462 -> JSM Object -- ^ Returns a JavaScript function object that will
@@ -466,21 +466,21 @@ function name f = liftIO $ do
466466 callback <- syncCallback2 ContinueAsync $ \this args -> do
467467 rargs <- Array.toListIO (coerce args)
468468 runReaderT (f this this rargs) () -- TODO pass function object through
469− makeFunctionWithCallback (makeStringRef name) callback
469+ makeFunctionWithCallback (makeString name) callback
470470foreign import javascript unsafe "$r = function () { $2(this, arguments); }"
471− makeFunctionWithCallback :: JSStringRef -> Callback (JSValueRef -> JSValueRef -> IO ()) -> IO Object
471+ makeFunctionWithCallback :: JSString -> Callback (JSVal -> JSVal -> IO ()) -> IO Object
472472#elif defined(USE_WEBKIT)
473473function name f = do
474474 gctxt <- ask
475475 callback <- liftIO $ mkJSObjectCallAsFunctionCallback wrap
476− liftIO $ Object <$> jsobjectmakefunctionwithcallback gctxt (makeStringRef name) callback
476+ liftIO $ Object <$> jsobjectmakefunctionwithcallback gctxt (makeString name) callback
477477 where
478478 wrap ctx fobj this argc argv exception = do
479479 args <- peekArray (fromIntegral argc) argv
480480 (`runReaderT` ctx) $
481− f fobj this args >>= makeValueRef
481+ f fobj this args >>= makeVal
482482 `E.catch` \(e :: SomeException) -> do
483− str <- runReaderT (makeValueRef . T.pack $ show e) ctx
483+ str <- runReaderT (makeVal . T.pack $ show e) ctx
484484 poke exception str
485485 jsvaluemakeundefined ctx
486486#else
@@ -490,33 +490,33 @@ function = undefined
490490-- | A callback to Haskell can be used as a JavaScript value. This will create
491491-- an anonymous JavaScript function object. Use 'function' to create one with
492492-- a name.
493−instance MakeValueRef JSCallAsFunction where
493+instance MakeVal JSCallAsFunction where
494494#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
495− makeValueRef f = jsval <$> function (pFromJSVal nullRef :: JSStringRef) f
495+ makeVal f = jsval <$> function (pFromJSVal nullRef :: JSString) f
496496#else
497− makeValueRef f = function (nullPtr :: JSStringRef) f >>= makeValueRef
497+ makeVal f = function (nullPtr :: JSString) f >>= makeVal
498498#endif
499− {-# INLINE makeValueRef #-}
499+ {-# INLINE makeVal #-}
500500
501−instance MakeArgRefs JSCallAsFunction where
502− makeArgRefs f = do
501+instance MakeArgs JSCallAsFunction where
502+ makeArgs f = do
503503#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
504− rarg <- jsval <$> function (pFromJSVal nullRef :: JSStringRef) f
504+ rarg <- jsval <$> function (pFromJSVal nullRef :: JSString) f
505505#else
506− rarg <- function (nullPtr:: JSStringRef) f >>= makeValueRef
506+ rarg <- function (nullPtr:: JSString) f >>= makeVal
507507#endif
508508 return [rarg]
509− {-# INLINE makeArgRefs #-}
509+ {-# INLINE makeArgs #-}
510510
511−makeArray :: MakeArgRefs args => args -> JSValueRefRef -> JSM Object
511+makeArray :: MakeArgs args => args -> MutableJSArray -> JSM Object
512512#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
513513makeArray args exceptions = do
514− rargs <- makeArgRefs args
514+ rargs <- makeArgs args
515515 liftIO $ Object . jsval <$> Array.fromListIO rargs
516516#else
517517makeArray args exceptions = do
518518 gctxt <- ask
519− rargs <- makeArgRefs args
519+ rargs <- makeArgs args
520520 liftIO $ withArrayLen rargs $ \ len ptr ->
521521 Object <$> jsobjectmakearray gctxt (fromIntegral len) ptr exceptions
522522#endif
@@ -530,7 +530,7 @@ makeArray args exceptions = do
530530-- >>> testJSaddle $ eval "['Hello', null, undefined, true, 1]"
531531-- >>> testJSaddle $ array ("Hello", JSNull, (), True, 1.0::Double)
532532-- Hello,,,true,1
533−array :: MakeArgRefs args => args -> JSM Object
533+array :: MakeArgs args => args -> JSM Object
534534array = rethrow . makeArray
535535
536536-- | JavaScript's global object
@@ -549,7 +549,7 @@ global = undefined
549549
550550-- | Get an array containing the property names present on a given object
551551#if (!defined(ghcjs_HOST_OS) || !defined(USE_JAVASCRIPTFFI)) && defined(USE_WEBKIT)
552−copyPropertyNames :: MakeObject this => this -> JSM JSPropertyNameArrayRef
552+copyPropertyNames :: MakeObject this => this -> JSM JSPropertyNameArray
553553copyPropertyNames this = do
554554 gctxt <- ask
555555 Object rthis <- makeObject this
@@ -557,17 +557,17 @@ copyPropertyNames this = do
557557{-# INLINE copyPropertyNames #-}
558558
559559-- | Get the number of names in a property name array
560−propertyNamesCount :: MonadIO m => JSPropertyNameArrayRef -> m CSize
560+propertyNamesCount :: MonadIO m => JSPropertyNameArray -> m CSize
561561propertyNamesCount names = liftIO $ jspropertynamearraygetcount names
562562{-# INLINE propertyNamesCount #-}
563563
564564-- | Get a name out of a property name array
565−propertyNamesAt :: MonadIO m => JSPropertyNameArrayRef -> CSize -> m JSStringRef
565+propertyNamesAt :: MonadIO m => JSPropertyNameArray -> CSize -> m JSString
566566propertyNamesAt names index = liftIO $ jspropertynamearraygetnameatindex names index
567567{-# INLINE propertyNamesAt #-}
568568
569569-- | Convert property array to a list
570−propertyNamesList :: MonadIO m => JSPropertyNameArrayRef -> m [JSStringRef]
570+propertyNamesList :: MonadIO m => JSPropertyNameArray -> m [JSString]
571571propertyNamesList names = do
572572 count <- propertyNamesCount names
573573 mapM (propertyNamesAt names) $ enumFromTo 0 (count - 1)
@@ -575,7 +575,7 @@ propertyNamesList names = do
575575#endif
576576
577577-- | Get a list containing the property names present on a given object
578−propertyNames :: MakeObject this => this -> JSM [JSStringRef]
578+propertyNames :: MakeObject this => this -> JSM [JSString]
579579#if defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)
580580propertyNames this = makeObject this >>= liftIO . js_propertyNames >>= liftIO . (fmap (map pFromJSVal)) . Array.toListIO
581581{-# INLINE propertyNames #-}
@@ -589,27 +589,27 @@ propertyNames = undefined
589589#endif
590590
591591-- | Get a list containing references to all the properties present on a given object
592−properties :: MakeObject this => this -> JSM [JSValueRef]
592+properties :: MakeObject this => this -> JSM [JSVal]
593593properties this = propertyNames this >>= mapM (this !)
594594
595595-- | Call a JavaScript object as function. Consider using '#'.
596−objCallAsFunction :: MakeArgRefs args
596+objCallAsFunction :: MakeArgs args
597597 => Object
598598 -> Object
599599 -> args
600− -> JSValueRefRef
601− -> JSM JSValueRef
600+ -> MutableJSArray
601+ -> JSM JSVal
602602#if defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)
603603objCallAsFunction function this args exceptions = do
604− rargs <- makeArgRefs args >>= liftIO . Array.fromListIO
604+ rargs <- makeArgs args >>= liftIO . Array.fromListIO
605605 liftIO $ js_apply function this rargs exceptions
606606{-# INLINE objCallAsFunction #-}
607607foreign import javascript unsafe "try { $r = $1.apply($2, $3) } catch(e) { $4[0] = e }"
608− js_apply :: Object -> Object -> JSValueRefRef -> JSValueRefRef -> IO JSValueRef
608+ js_apply :: Object -> Object -> MutableJSArray -> MutableJSArray -> IO JSVal
609609#elif defined(USE_WEBKIT)
610610objCallAsFunction (Object function) (Object this) args exceptions = do
611611 gctxt <- ask
612− rargs <- makeArgRefs args
612+ rargs <- makeArgs args
613613 liftIO $ withArrayLen rargs $ \ largs pargs ->
614614 jsobjectcallasfunction gctxt function this (fromIntegral largs) pargs exceptions
615615{-# INLINE objCallAsFunction #-}
@@ -621,14 +621,14 @@ objCallAsFunction = undefined
621621--
622622-- If you pass more than 7 arguments to a constructor for a built in
623623-- JavaScript type (like Date) then this function will fail.
624−objCallAsConstructor :: MakeArgRefs args
624+objCallAsConstructor :: MakeArgs args
625625 => Object
626626 -> args
627− -> JSValueRefRef
628− -> JSM JSValueRef
627+ -> MutableJSArray
628+ -> JSM JSVal
629629#if defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)
630630objCallAsConstructor function args exceptions = do
631− rargs <- makeArgRefs args >>= liftIO . Array.fromListIO
631+ rargs <- makeArgs args >>= liftIO . Array.fromListIO
632632 liftIO $ js_new function rargs exceptions
633633foreign import javascript unsafe "\
634634 try {\
@@ -657,11 +657,11 @@ foreign import javascript unsafe "\
657657 catch(e) {\
658658 $3[0] = e;\
659659 }"
660− js_new :: Object -> JSValueRefRef -> JSValueRefRef -> IO JSValueRef
660+ js_new :: Object -> MutableJSArray -> MutableJSArray -> IO JSVal
661661#elif defined(USE_WEBKIT)
662662objCallAsConstructor (Object function) args exceptions = do
663663 gctxt <- ask
664− rargs <- makeArgRefs args
664+ rargs <- makeArgs args
665665 liftIO $ withArrayLen rargs $ \ largs pargs ->
666666 jsobjectcallasconstructor gctxt function (fromIntegral largs) pargs exceptions
667667#else