Bustage fix for bug 465141
authorShawn Wilsher <me@shawnwilsher.com>
Thu, 27 Nov 2008 13:56:41 -0800
changeset 22047 2505e91f4141f00c1c0e04e527a822074b06cdf0
parent 22046 0336f989855a5aefa8b4371b0bdbdcc2aa53b968
child 22049 192392e7bb2c8181e897584771265959f09d0679
child 22054 4ff260cb5feab1570f85f8bed834d9a9931d466d
push idunknown
push userunknown
push dateunknown
bugs465141
milestone1.9.1b3pre
Bustage fix for bug 465141
dom/src/threads/nsDOMWorkerTimeout.cpp
--- a/dom/src/threads/nsDOMWorkerTimeout.cpp
+++ b/dom/src/threads/nsDOMWorkerTimeout.cpp
@@ -121,25 +121,25 @@ nsDOMWorkerTimeout::FunctionCallback::Ru
 {
   PRInt32 lateness = PR_MAX(0, PRInt32(PR_Now() - aTimeout->mTargetTime)) /
                      (PRTime)PR_USEC_PER_MSEC;
   mCallbackArgs[mCallbackArgsLength - 1] = INT_TO_JSVAL(lateness);
 
   JSObject* global = JS_GetGlobalObject(aCx);
   NS_ENSURE_TRUE(global, NS_ERROR_FAILURE);
 
-  jsval argv[mCallbackArgsLength];
+  nsTArray<jsval> argv(mCallbackArgsLength);
   for (PRUint32 index = 0; index < mCallbackArgsLength; index++) {
-    argv[index] = mCallbackArgs[index];
+    argv.AppendElement(mCallbackArgs[index]);
   }
 
   jsval rval;
   JSBool ok =
     JS_CallFunctionValue(aCx, global, mCallback, mCallbackArgsLength,
-                         argv, &rval);
+                         argv.Elements(), &rval);
   NS_ENSURE_TRUE(ok, NS_ERROR_FAILURE);
 
   return NS_OK;
 }
 
 nsDOMWorkerTimeout::ExpressionCallback::ExpressionCallback(PRUint32 aArgc,
                                                            jsval* aArgv,
                                                            JSContext* aCx,