1
0
forked from mirrors/0ad

[SM91] Update to Spidermonkey 91.1.3 APIs

Fixes: #5986
Patch by: @wraitii
Comments by: @nwtour, @Stan
Differential Revision: https://code.wildfiregames.com/D4428
This was SVN commit r27409.
This commit is contained in:
Stan
2023-01-10 17:06:47 +00:00
parent 03c3d2d438
commit d5db03c303
11 changed files with 49 additions and 42 deletions
+5 -5
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2022 Wildfire Games.
/* Copyright (C) 2023 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -533,11 +533,11 @@ bool ScriptInterface::SetGlobal_(const char* name, JS::HandleValue value, bool r
return false;
if (found)
{
JS::Rooted<JS::PropertyDescriptor> desc(rq.cx);
if (!JS_GetOwnPropertyDescriptor(rq.cx, global, name, &desc))
JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(rq.cx);
if (!JS_GetOwnPropertyDescriptor(rq.cx, global, name, &desc) || !desc.isSome())
return false;
if (!desc.writable())
if (!desc->writable())
{
if (!replace)
{
@@ -547,7 +547,7 @@ bool ScriptInterface::SetGlobal_(const char* name, JS::HandleValue value, bool r
// This is not supposed to happen, unless the user has called SetProperty with constant = true on the global object
// instead of using SetGlobal.
if (!desc.configurable())
if (!desc->configurable())
{
ScriptException::Raise(rq, "The global \"%s\" is permanent and cannot be hotloaded", name);
return false;