mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 972132 - Convert JS::EmptyValueArray to JS::HandleValueArray::empty(). r=terrence
--HG-- extra : rebase_source : 58b87df07373a7811136682b128aea67f04446cd
This commit is contained in:
parent
e104f14409
commit
5a7db86560
@ -703,12 +703,12 @@ nsFrameMessageManager::BroadcastAsyncMessage(const nsAString& aMessageName,
|
||||
NS_IMETHODIMP
|
||||
nsFrameMessageManager::GetChildCount(uint32_t* aChildCount)
|
||||
{
|
||||
*aChildCount = static_cast<uint32_t>(mChildManagers.Count());
|
||||
*aChildCount = static_cast<uint32_t>(mChildManagers.Count());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFrameMessageManager::GetChildAt(uint32_t aIndex,
|
||||
nsFrameMessageManager::GetChildAt(uint32_t aIndex,
|
||||
nsIMessageListenerManager** aMM)
|
||||
{
|
||||
*aMM = nullptr;
|
||||
@ -1429,7 +1429,8 @@ nsFrameScriptExecutor::LoadFrameScriptInternal(const nsAString& aURL,
|
||||
}
|
||||
JS::Rooted<JS::Value> rval(cx);
|
||||
JS::Rooted<JS::Value> methodVal(cx, JS::ObjectValue(*method));
|
||||
ok = JS_CallFunctionValue(cx, global, methodVal, JS::EmptyValueArray, &rval);
|
||||
ok = JS_CallFunctionValue(cx, global, methodVal,
|
||||
JS::HandleValueArray::empty(), &rval);
|
||||
} else if (script) {
|
||||
ok = JS_ExecuteScript(cx, global, script, nullptr);
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ ErrorResult::ReportJSExceptionFromJSImplementation(JSContext* aCx)
|
||||
|
||||
JS_ReportError(aCx, "%hs", message.get());
|
||||
JS_RemoveValueRoot(aCx, &mJSException);
|
||||
|
||||
|
||||
// We no longer have a useful exception but we do want to signal that an error
|
||||
// occured.
|
||||
mResult = NS_ERROR_FAILURE;
|
||||
@ -1573,7 +1573,8 @@ NativeToString(JSContext* cx, JS::Handle<JSObject*> wrapper,
|
||||
}
|
||||
MOZ_ASSERT(JS_ObjectIsCallable(cx, &toString.toObject()));
|
||||
JS::Rooted<JS::Value> toStringResult(cx);
|
||||
if (JS_CallFunctionValue(cx, obj, toString, JS::EmptyValueArray, &toStringResult)) {
|
||||
if (JS_CallFunctionValue(cx, obj, toString, JS::HandleValueArray::empty(),
|
||||
&toStringResult)) {
|
||||
str = toStringResult.toString();
|
||||
} else {
|
||||
str = nullptr;
|
||||
|
@ -11351,7 +11351,7 @@ class CallbackMethod(CallbackMember):
|
||||
if self.argCount > 0:
|
||||
replacements["args"] = "JS::HandleValueArray::subarray(argv, 0, argc)"
|
||||
else:
|
||||
replacements["args"] = "JS::EmptyValueArray"
|
||||
replacements["args"] = "JS::HandleValueArray::empty()"
|
||||
return string.Template("${declCallable}${declThis}"
|
||||
"if (${callGuard}!JS::Call(cx, ${thisVal}, callable,\n"
|
||||
" ${args}, &rval)) {\n"
|
||||
|
@ -1606,7 +1606,7 @@ NPObjWrapper_Convert(JSContext *cx, JS::Handle<JSObject*> obj, JSType hint, JS::
|
||||
if (!JS_GetProperty(cx, obj, "toString", &v))
|
||||
return false;
|
||||
if (!JSVAL_IS_PRIMITIVE(v) && JS_ObjectIsCallable(cx, JSVAL_TO_OBJECT(v))) {
|
||||
if (!JS_CallFunctionValue(cx, obj, v, JS::EmptyValueArray, vp))
|
||||
if (!JS_CallFunctionValue(cx, obj, v, JS::HandleValueArray::empty(), vp))
|
||||
return false;
|
||||
if (JSVAL_IS_PRIMITIVE(vp))
|
||||
return true;
|
||||
|
@ -220,7 +220,7 @@ nsJSON::EncodeInternal(JSContext* cx, const JS::Value& aValue,
|
||||
toJSON.isObject() &&
|
||||
JS_ObjectIsCallable(cx, &toJSON.toObject())) {
|
||||
// If toJSON is implemented, it must not throw
|
||||
if (!JS_CallFunctionValue(cx, obj, toJSON, JS::EmptyValueArray, &val)) {
|
||||
if (!JS_CallFunctionValue(cx, obj, toJSON, JS::HandleValueArray::empty(), &val)) {
|
||||
if (JS_IsExceptionPending(cx))
|
||||
// passing NS_OK will throw the pending exception
|
||||
return NS_OK;
|
||||
@ -482,7 +482,7 @@ NS_NewJSON(nsISupports* aOuter, REFNSIID aIID, void** aResult)
|
||||
|
||||
nsJSONListener::nsJSONListener(JSContext *cx, JS::Value *rootVal,
|
||||
bool needsConverter)
|
||||
: mNeedsConverter(needsConverter),
|
||||
: mNeedsConverter(needsConverter),
|
||||
mCx(cx),
|
||||
mRootVal(rootVal)
|
||||
{
|
||||
@ -551,7 +551,7 @@ nsJSONListener::OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext,
|
||||
if (mSniffBuffer.Length() < 4)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
char buffer[JSON_STREAM_BUFSIZE];
|
||||
unsigned long bytesRemaining = aLength - mSniffBuffer.Length();
|
||||
while (bytesRemaining) {
|
||||
|
@ -39,7 +39,7 @@ nsXBLProtoImplMethod::~nsXBLProtoImplMethod()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
nsXBLProtoImplMethod::AppendBodyText(const nsAString& aText)
|
||||
{
|
||||
NS_PRECONDITION(!IsCompiled(),
|
||||
@ -56,7 +56,7 @@ nsXBLProtoImplMethod::AppendBodyText(const nsAString& aText)
|
||||
uncompiledMethod->AppendBodyText(aText);
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
nsXBLProtoImplMethod::AddParameter(const nsAString& aText)
|
||||
{
|
||||
NS_PRECONDITION(!IsCompiled(),
|
||||
@ -125,7 +125,7 @@ nsXBLProtoImplMethod::InstallMember(JSContext* aCx,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsresult
|
||||
nsXBLProtoImplMethod::CompileMember(const nsCString& aClassStr,
|
||||
JS::Handle<JSObject*> aClassObject)
|
||||
{
|
||||
@ -165,9 +165,9 @@ nsXBLProtoImplMethod::CompileMember(const nsCString& aClassStr,
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
// Add our parameters to our args array.
|
||||
int32_t argPos = 0;
|
||||
for (nsXBLParameter* curr = uncompiledMethod->mParameters;
|
||||
curr;
|
||||
int32_t argPos = 0;
|
||||
for (nsXBLParameter* curr = uncompiledMethod->mParameters;
|
||||
curr;
|
||||
curr = curr->mNext) {
|
||||
args[argPos] = curr->mName;
|
||||
argPos++;
|
||||
@ -335,7 +335,7 @@ nsXBLProtoImplAnonymousMethod::Execute(nsIContent* aBoundElement)
|
||||
if (scriptAllowed) {
|
||||
JS::Rooted<JS::Value> retval(cx);
|
||||
JS::Rooted<JS::Value> methodVal(cx, JS::ObjectValue(*method));
|
||||
ok = ::JS::Call(cx, thisObject, methodVal, JS::EmptyValueArray, &retval);
|
||||
ok = ::JS::Call(cx, thisObject, methodVal, JS::HandleValueArray::empty(), &retval);
|
||||
}
|
||||
|
||||
if (!ok) {
|
||||
|
@ -21,7 +21,7 @@ BEGIN_TEST(test_BindCallable)
|
||||
|
||||
JS::RootedValue retval(cx);
|
||||
JS::RootedValue fun(cx, JS::ObjectValue(*newCallable));
|
||||
bool called = JS_CallFunctionValue(cx, JS::NullPtr(), fun, JS::EmptyValueArray, &retval);
|
||||
bool called = JS_CallFunctionValue(cx, JS::NullPtr(), fun, JS::HandleValueArray::empty(), &retval);
|
||||
CHECK(called);
|
||||
|
||||
CHECK(JSVAL_IS_INT(retval));
|
||||
|
@ -56,7 +56,8 @@ BEGIN_TEST(test_CallNonGenericMethodOnProxy)
|
||||
CHECK(customMethodA);
|
||||
|
||||
JS::RootedValue rval(cx);
|
||||
CHECK(JS_CallFunction(cx, customA, customMethodA, JS::EmptyValueArray, &rval));
|
||||
CHECK(JS_CallFunction(cx, customA, customMethodA, JS::HandleValueArray::empty(),
|
||||
&rval));
|
||||
CHECK_SAME(rval, Int32Value(17));
|
||||
|
||||
// Now create the second global object and compartment...
|
||||
@ -74,14 +75,16 @@ BEGIN_TEST(test_CallNonGenericMethodOnProxy)
|
||||
CHECK(customMethodB);
|
||||
|
||||
JS::RootedValue rval(cx);
|
||||
CHECK(JS_CallFunction(cx, customB, customMethodB, JS::EmptyValueArray, &rval));
|
||||
CHECK(JS_CallFunction(cx, customB, customMethodB, JS::HandleValueArray::empty(),
|
||||
&rval));
|
||||
CHECK_SAME(rval, Int32Value(42));
|
||||
|
||||
JS::RootedObject wrappedCustomA(cx, customA);
|
||||
CHECK(JS_WrapObject(cx, &wrappedCustomA));
|
||||
|
||||
JS::RootedValue rval2(cx);
|
||||
CHECK(JS_CallFunction(cx, wrappedCustomA, customMethodB, JS::EmptyValueArray, &rval2));
|
||||
CHECK(JS_CallFunction(cx, wrappedCustomA, customMethodB, JS::HandleValueArray::empty(),
|
||||
&rval2));
|
||||
CHECK_SAME(rval, Int32Value(42));
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ CallTrusted(JSContext *cx, unsigned argc, jsval *vp)
|
||||
{
|
||||
JSAutoCompartment ac(cx, trusted_glob);
|
||||
JS::RootedValue funVal(cx, JS::ObjectValue(*trusted_fun));
|
||||
ok = JS_CallFunctionValue(cx, JS::NullPtr(), funVal, JS::EmptyValueArray, args.rval());
|
||||
ok = JS_CallFunctionValue(cx, JS::NullPtr(), funVal, JS::HandleValueArray::empty(), args.rval());
|
||||
}
|
||||
JS_RestoreFrameChain(cx);
|
||||
return ok;
|
||||
|
@ -63,7 +63,8 @@ BEGIN_TEST(testClassGetter_isCalled)
|
||||
|
||||
for (int i = 1; i < 9; i++) {
|
||||
JS::RootedValue rval(cx);
|
||||
CHECK(JS_CallFunctionName(cx, global, "check", JS::EmptyValueArray, &rval));
|
||||
CHECK(JS_CallFunctionName(cx, global, "check", JS::HandleValueArray::empty(),
|
||||
&rval));
|
||||
CHECK_SAME(INT_TO_JSVAL(called_test_fn), INT_TO_JSVAL(i));
|
||||
CHECK_SAME(INT_TO_JSVAL(called_test_prop_get), INT_TO_JSVAL(4 * i));
|
||||
}
|
||||
|
@ -20,7 +20,8 @@ BEGIN_TEST(testErrorCopying_columnCopied)
|
||||
|
||||
JS::RootedValue rval(cx);
|
||||
JS_SetErrorReporter(cx, my_ErrorReporter);
|
||||
CHECK(!JS_CallFunctionName(cx, global, "check", JS::EmptyValueArray, &rval));
|
||||
CHECK(!JS_CallFunctionName(cx, global, "check", JS::HandleValueArray::empty(),
|
||||
&rval));
|
||||
CHECK(column == 27);
|
||||
return true;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ BEGIN_TEST(testException_bug860435)
|
||||
CHECK(fun.isObject());
|
||||
|
||||
JS::RootedValue v(cx);
|
||||
JS_CallFunctionValue(cx, global, fun, JS::EmptyValueArray, &v);
|
||||
JS_CallFunctionValue(cx, global, fun, JS::HandleValueArray::empty(), &v);
|
||||
CHECK(v.isObject());
|
||||
JS::RootedObject obj(cx, &v.toObject());
|
||||
|
||||
|
@ -55,7 +55,8 @@ BEGIN_TEST(testOps_bug559006)
|
||||
|
||||
for (int i = 0; i < 9; i++) {
|
||||
JS::RootedValue rval(cx);
|
||||
CHECK(JS_CallFunctionName(cx, global, "main", JS::EmptyValueArray, &rval));
|
||||
CHECK(JS_CallFunctionName(cx, global, "main", JS::HandleValueArray::empty(),
|
||||
&rval));
|
||||
CHECK_SAME(rval, INT_TO_JSVAL(123));
|
||||
}
|
||||
return true;
|
||||
|
@ -42,7 +42,7 @@ test_fn2(JSContext *cx, unsigned argc, jsval *vp)
|
||||
{
|
||||
JS::RootedValue r(cx);
|
||||
JS::RootedObject global(cx, JS::CurrentGlobalOrNull(cx));
|
||||
return JS_CallFunctionName(cx, global, "d", JS::EmptyValueArray, &r);
|
||||
return JS_CallFunctionName(cx, global, "d", JS::HandleValueArray::empty(), &r);
|
||||
}
|
||||
|
||||
static bool
|
||||
@ -104,13 +104,15 @@ BEGIN_TEST(testProfileStrings_isCalledWithInterpreter)
|
||||
{
|
||||
JS::RootedValue rval(cx);
|
||||
/* Make sure the stack resets and we have an entry for each stack */
|
||||
CHECK(JS_CallFunctionName(cx, global, "check", JS::EmptyValueArray, &rval));
|
||||
CHECK(JS_CallFunctionName(cx, global, "check", JS::HandleValueArray::empty(),
|
||||
&rval));
|
||||
CHECK(psize == 0);
|
||||
CHECK(max_stack >= 8);
|
||||
CHECK(cx->runtime()->spsProfiler.stringsCount() == 8);
|
||||
/* Make sure the stack resets and we added no new entries */
|
||||
max_stack = 0;
|
||||
CHECK(JS_CallFunctionName(cx, global, "check", JS::EmptyValueArray, &rval));
|
||||
CHECK(JS_CallFunctionName(cx, global, "check", JS::HandleValueArray::empty(),
|
||||
&rval));
|
||||
CHECK(psize == 0);
|
||||
CHECK(max_stack >= 8);
|
||||
CHECK(cx->runtime()->spsProfiler.stringsCount() == 8);
|
||||
@ -118,7 +120,8 @@ BEGIN_TEST(testProfileStrings_isCalledWithInterpreter)
|
||||
reset(cx);
|
||||
{
|
||||
JS::RootedValue rval(cx);
|
||||
CHECK(JS_CallFunctionName(cx, global, "check2", JS::EmptyValueArray, &rval));
|
||||
CHECK(JS_CallFunctionName(cx, global, "check2", JS::HandleValueArray::empty(),
|
||||
&rval));
|
||||
CHECK(cx->runtime()->spsProfiler.stringsCount() == 5);
|
||||
CHECK(max_stack >= 6);
|
||||
CHECK(psize == 0);
|
||||
@ -129,7 +132,8 @@ BEGIN_TEST(testProfileStrings_isCalledWithInterpreter)
|
||||
{
|
||||
JS::RootedValue rval(cx);
|
||||
pstack[3].setLabel((char*) 1234);
|
||||
CHECK(JS_CallFunctionName(cx, global, "check", JS::EmptyValueArray, &rval));
|
||||
CHECK(JS_CallFunctionName(cx, global, "check", JS::HandleValueArray::empty(),
|
||||
&rval));
|
||||
CHECK((size_t) pstack[3].label() == 1234);
|
||||
CHECK(max_stack >= 8);
|
||||
CHECK(psize == 0);
|
||||
@ -158,14 +162,16 @@ BEGIN_TEST(testProfileStrings_isCalledWithJIT)
|
||||
{
|
||||
JS::RootedValue rval(cx);
|
||||
/* Make sure the stack resets and we have an entry for each stack */
|
||||
CHECK(JS_CallFunctionName(cx, global, "check", JS::EmptyValueArray, &rval));
|
||||
CHECK(JS_CallFunctionName(cx, global, "check", JS::HandleValueArray::empty(),
|
||||
&rval));
|
||||
CHECK(psize == 0);
|
||||
CHECK(max_stack >= 8);
|
||||
|
||||
/* Make sure the stack resets and we added no new entries */
|
||||
uint32_t cnt = cx->runtime()->spsProfiler.stringsCount();
|
||||
max_stack = 0;
|
||||
CHECK(JS_CallFunctionName(cx, global, "check", JS::EmptyValueArray, &rval));
|
||||
CHECK(JS_CallFunctionName(cx, global, "check", JS::HandleValueArray::empty(),
|
||||
&rval));
|
||||
CHECK(psize == 0);
|
||||
CHECK(cx->runtime()->spsProfiler.stringsCount() == cnt);
|
||||
CHECK(max_stack >= 8);
|
||||
@ -178,7 +184,8 @@ BEGIN_TEST(testProfileStrings_isCalledWithJIT)
|
||||
/* Limit the size of the stack and make sure we don't overflow */
|
||||
JS::RootedValue rval(cx);
|
||||
pstack[3].setLabel((char*) 1234);
|
||||
CHECK(JS_CallFunctionName(cx, global, "check", JS::EmptyValueArray, &rval));
|
||||
CHECK(JS_CallFunctionName(cx, global, "check", JS::HandleValueArray::empty(),
|
||||
&rval));
|
||||
CHECK(psize == 0);
|
||||
CHECK(max_stack >= 8);
|
||||
CHECK((size_t) pstack[3].label() == 1234);
|
||||
@ -200,7 +207,8 @@ BEGIN_TEST(testProfileStrings_isCalledWhenError)
|
||||
{
|
||||
JS::RootedValue rval(cx);
|
||||
/* Make sure the stack resets and we have an entry for each stack */
|
||||
bool ok = JS_CallFunctionName(cx, global, "check2", JS::EmptyValueArray, &rval);
|
||||
bool ok = JS_CallFunctionName(cx, global, "check2", JS::HandleValueArray::empty(),
|
||||
&rval);
|
||||
CHECK(!ok);
|
||||
CHECK(psize == 0);
|
||||
CHECK(cx->runtime()->spsProfiler.stringsCount() == 1);
|
||||
@ -224,7 +232,7 @@ BEGIN_TEST(testProfileStrings_worksWhenEnabledOnTheFly)
|
||||
{
|
||||
/* enable it in the middle of JS and make sure things check out */
|
||||
JS::RootedValue rval(cx);
|
||||
JS_CallFunctionName(cx, global, "a", JS::EmptyValueArray, &rval);
|
||||
JS_CallFunctionName(cx, global, "a", JS::HandleValueArray::empty(), &rval);
|
||||
CHECK(psize == 0);
|
||||
CHECK(max_stack >= 1);
|
||||
CHECK(cx->runtime()->spsProfiler.stringsCount() == 1);
|
||||
@ -236,7 +244,7 @@ BEGIN_TEST(testProfileStrings_worksWhenEnabledOnTheFly)
|
||||
{
|
||||
/* now disable in the middle of js */
|
||||
JS::RootedValue rval(cx);
|
||||
JS_CallFunctionName(cx, global, "c", JS::EmptyValueArray, &rval);
|
||||
JS_CallFunctionName(cx, global, "c", JS::HandleValueArray::empty(), &rval);
|
||||
CHECK(psize == 0);
|
||||
}
|
||||
|
||||
@ -245,7 +253,7 @@ BEGIN_TEST(testProfileStrings_worksWhenEnabledOnTheFly)
|
||||
{
|
||||
/* now disable in the middle of js, but re-enable before final exit */
|
||||
JS::RootedValue rval(cx);
|
||||
JS_CallFunctionName(cx, global, "e", JS::EmptyValueArray, &rval);
|
||||
JS_CallFunctionName(cx, global, "e", JS::HandleValueArray::empty(), &rval);
|
||||
CHECK(psize == 0);
|
||||
CHECK(max_stack >= 3);
|
||||
}
|
||||
@ -259,7 +267,7 @@ BEGIN_TEST(testProfileStrings_worksWhenEnabledOnTheFly)
|
||||
JS::RootedValue rval(cx);
|
||||
/* disable, and make sure that if we try to re-enter the JIT the pop
|
||||
* will still happen */
|
||||
JS_CallFunctionName(cx, global, "f", JS::EmptyValueArray, &rval);
|
||||
JS_CallFunctionName(cx, global, "f", JS::HandleValueArray::empty(), &rval);
|
||||
CHECK(psize == 0);
|
||||
}
|
||||
return true;
|
||||
|
@ -116,8 +116,6 @@ using js::frontend::Parser;
|
||||
JS_STATIC_ASSERT((jschar)-1 > 0);
|
||||
JS_STATIC_ASSERT(sizeof(jschar) == 2);
|
||||
|
||||
const JS::HandleValueArray JS::EmptyValueArray;
|
||||
|
||||
JS_PUBLIC_API(int64_t)
|
||||
JS_Now()
|
||||
{
|
||||
|
@ -604,12 +604,11 @@ class JS_PUBLIC_API(CustomAutoRooter) : private AutoGCRooter
|
||||
class HandleValueArray
|
||||
{
|
||||
const size_t length_;
|
||||
const Value *elements_;
|
||||
const Value * const elements_;
|
||||
|
||||
HandleValueArray(size_t len, const Value *elements) : length_(len), elements_(elements) {}
|
||||
|
||||
public:
|
||||
HandleValueArray() : length_(0), elements_(nullptr) {}
|
||||
HandleValueArray(const RootedValue& value) : length_(1), elements_(value.address()) {}
|
||||
|
||||
HandleValueArray(const AutoValueVector& values)
|
||||
@ -631,6 +630,10 @@ class HandleValueArray
|
||||
return HandleValueArray(len, values.begin() + startIndex);
|
||||
}
|
||||
|
||||
static HandleValueArray empty() {
|
||||
return HandleValueArray(0, nullptr);
|
||||
}
|
||||
|
||||
size_t length() const { return length_; }
|
||||
const Value *begin() const { return elements_; }
|
||||
|
||||
@ -640,8 +643,6 @@ class HandleValueArray
|
||||
}
|
||||
};
|
||||
|
||||
extern JS_PUBLIC_DATA(const HandleValueArray) EmptyValueArray;
|
||||
|
||||
} /* namespace JS */
|
||||
|
||||
/************************************************************************/
|
||||
|
@ -326,8 +326,11 @@ ShellOperationCallback(JSContext *cx)
|
||||
JSAutoCompartment ac(cx, &gTimeoutFunc.toObject());
|
||||
RootedValue rval(cx);
|
||||
HandleValue timeoutFunc = HandleValue::fromMarkedLocation(&gTimeoutFunc);
|
||||
if (!JS_CallFunctionValue(cx, JS::NullPtr(), timeoutFunc, JS::EmptyValueArray, &rval))
|
||||
if (!JS_CallFunctionValue(cx, JS::NullPtr(), timeoutFunc,
|
||||
JS::HandleValueArray::empty(), &rval))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (rval.isBoolean())
|
||||
result = rval.toBoolean();
|
||||
else
|
||||
@ -4256,7 +4259,7 @@ WithSourceHook(JSContext *cx, unsigned argc, jsval *vp)
|
||||
SourceHook *savedHook = js::ForgetSourceHook(cx->runtime());
|
||||
js::SetSourceHook(cx->runtime(), hook);
|
||||
RootedObject fun(cx, &args[1].toObject());
|
||||
bool result = Call(cx, UndefinedHandleValue, fun, JS::EmptyValueArray, args.rval());
|
||||
bool result = Call(cx, UndefinedHandleValue, fun, JS::HandleValueArray::empty(), args.rval());
|
||||
js::SetSourceHook(cx->runtime(), savedHook);
|
||||
return result;
|
||||
}
|
||||
|
@ -870,7 +870,7 @@ mozJSComponentLoader::ObjectForLocation(nsIFile *aComponentFile,
|
||||
#else /* HAVE_PR_MEMMAP */
|
||||
|
||||
/**
|
||||
* No memmap implementation, so fall back to
|
||||
* No memmap implementation, so fall back to
|
||||
* reading in the file
|
||||
*/
|
||||
|
||||
@ -1013,7 +1013,7 @@ mozJSComponentLoader::ObjectForLocation(nsIFile *aComponentFile,
|
||||
ok = JS_ExecuteScriptVersion(cx, obj, script, nullptr, JSVERSION_LATEST);
|
||||
} else {
|
||||
RootedValue rval(cx);
|
||||
ok = JS_CallFunction(cx, obj, function, JS::EmptyValueArray, &rval);
|
||||
ok = JS_CallFunction(cx, obj, function, JS::HandleValueArray::empty(), &rval);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -348,7 +348,8 @@ mozJSSubScriptLoader::DoLoadSubScriptWithOptions(const nsAString &url,
|
||||
|
||||
bool ok = false;
|
||||
if (function) {
|
||||
ok = JS_CallFunction(cx, targetObj, function, JS::EmptyValueArray, retval);
|
||||
ok = JS_CallFunction(cx, targetObj, function, JS::HandleValueArray::empty(),
|
||||
retval);
|
||||
} else {
|
||||
ok = JS_ExecuteScriptVersion(cx, targetObj, script, retval.address(), version);
|
||||
}
|
||||
|
@ -662,7 +662,7 @@ XPCShellOperationCallback(JSContext *cx)
|
||||
JSAutoCompartment ac(cx, &sScriptedOperationCallback.toObject());
|
||||
RootedValue rv(cx);
|
||||
RootedValue callback(cx, sScriptedOperationCallback);
|
||||
if (!JS_CallFunctionValue(cx, JS::NullPtr(), callback, JS::EmptyValueArray, &rv) ||
|
||||
if (!JS_CallFunctionValue(cx, JS::NullPtr(), callback, JS::HandleValueArray::empty(), &rv) ||
|
||||
!rv.isBoolean())
|
||||
{
|
||||
NS_WARNING("Scripted operation callback failed! Terminating script.");
|
||||
|
Loading…
Reference in New Issue
Block a user