2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2006-06-13 07:07:47 +04:00
|
|
|
#ifndef nsDOMJSUtils_h__
|
|
|
|
#define nsDOMJSUtils_h__
|
|
|
|
|
|
|
|
#include "nsIScriptContext.h"
|
2013-10-11 02:22:35 +04:00
|
|
|
#include "jsapi.h"
|
2006-06-13 07:07:47 +04:00
|
|
|
|
2012-03-11 12:53:05 +04:00
|
|
|
class nsIJSArgArray;
|
|
|
|
|
2013-04-12 02:52:10 +04:00
|
|
|
// A factory function for turning a JS::Value argv into an nsIArray
|
2006-06-13 07:07:47 +04:00
|
|
|
// but also supports an effecient way of extracting the original argv.
|
|
|
|
// The resulting object will take a copy of the array, and ensure each
|
|
|
|
// element is rooted.
|
2013-10-28 18:04:12 +04:00
|
|
|
// Optionally, aArgv may be nullptr, in which case the array is allocated and
|
|
|
|
// rooted, but all items remain nullptr. This presumably means the caller
|
|
|
|
// will then QI us for nsIJSArgArray, and set our array elements.
|
2019-05-01 11:47:10 +03:00
|
|
|
nsresult NS_CreateJSArgv(JSContext* aContext, uint32_t aArgc,
|
|
|
|
const JS::Value* aArgv, nsIJSArgArray** aArray);
|
2006-06-13 07:07:47 +04:00
|
|
|
|
|
|
|
#endif // nsDOMJSUtils_h__
|