1
0
Fork 0

[spidermonkey] Migration to mozjs-91.

This commit is contained in:
Witold Filipczyk 2022-09-04 15:57:54 +02:00
parent e6271a85e7
commit 813e2e595f
22 changed files with 138 additions and 138 deletions

View File

@ -787,8 +787,8 @@ SPIDERMONKEY_FOUND=
if test "x$CONFIG_SPIDERMONKEY" = xyes ||
test "x$CONFIG_SCRIPTING_SPIDERMONKEY" = xyes; then
package=mozjs-78
AC_MSG_CHECKING([for SpiderMonkey (mozjs-78) in pkg-config $package])
package=mozjs-91
AC_MSG_CHECKING([for SpiderMonkey (mozjs-91) in pkg-config $package])
if $PKG_CONFIG $pkg_config_static --cflags --libs $package > /dev/null 2>&AS_MESSAGE_LOG_FD; then
DB_LOCALSTORAGE_LIBS="$($PKG_CONFIG $pkg_config_static --libs sqlite3)"
XMLPLUSPLUS_LIBS="$($PKG_CONFIG $pkg_config_static --libs libxml++-5.0)"

View File

@ -379,7 +379,7 @@ if conf_data.get('CONFIG_BZIP2')
endif
if conf_data.get('CONFIG_ECMASCRIPT_SMJS') or conf_data.get('CONFIG_SCRIPTING_SPIDERMONKEY')
mozjsdeps = dependency('mozjs-78', static: st)
mozjsdeps = dependency('mozjs-91', static: st)
deps += mozjsdeps
endif

View File

@ -104,7 +104,7 @@ error_reporter(JSContext *ctx, JSErrorReport *report)
f = open_memstream(&ptr, &size);
if (f) {
JS::PrintError(ctx, f, report, true/*reportWarnings*/);
JS::PrintError(f, report, true/*reportWarnings*/);
fclose(f);
if (!init_string(&msg)) {
@ -242,7 +242,7 @@ spidermonkey_get_interpreter(struct ecmascript_interpreter *interpreter)
if (!menubar_obj) {
goto release_and_fail;
}
JS_SetPrivate(menubar_obj, (char *)"t"); /* to @menubar_class */
JS::SetPrivate(menubar_obj, (char *)"t"); /* to @menubar_class */
statusbar_obj = JS_InitClass(ctx, window_obj, nullptr,
&statusbar_class, NULL, 0,
@ -251,7 +251,7 @@ spidermonkey_get_interpreter(struct ecmascript_interpreter *interpreter)
if (!statusbar_obj) {
goto release_and_fail;
}
JS_SetPrivate(statusbar_obj, (char *)"s"); /* to @statusbar_class */
JS::SetPrivate(statusbar_obj, (char *)"s"); /* to @statusbar_class */
navigator_obj = JS_InitClass(ctx, window_obj, nullptr,
&navigator_class, NULL, 0,
@ -318,7 +318,7 @@ spidermonkey_check_for_exception(JSContext *ctx) {
* Undefined and with line 0. Let's filter this. */
/* Optional printing javascript error to file */
//FILE *f = fopen("js.err","a");
//PrintError(ctx, f, report->message(), report, true);
//PrintError(f, report->message(), report, true);
/* Send the error to the tui */
error_reporter(ctx, report);
//DBG("file: %s",report->filename);

View File

@ -130,7 +130,7 @@ attr_get_property_name(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::AttributeNode *attr = static_cast<xmlpp::AttributeNode *>(JS_GetPrivate(hobj));
xmlpp::AttributeNode *attr = static_cast<xmlpp::AttributeNode *>(JS::GetPrivate(hobj));
if (!attr) {
args.rval().setNull();
@ -182,7 +182,7 @@ attr_get_property_value(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::AttributeNode *attr = static_cast<xmlpp::AttributeNode *>(JS_GetPrivate(hobj));
xmlpp::AttributeNode *attr = static_cast<xmlpp::AttributeNode *>(JS::GetPrivate(hobj));
if (!attr) {
args.rval().setNull();
@ -209,7 +209,7 @@ getAttr(JSContext *ctx, void *node)
JS_DefineProperties(ctx, r_el, (JSPropertySpec *) attr_props);
// spidermonkey_DefineFunctions(ctx, el, attributes_funcs);
JS_SetPrivate(el, node);
JS::SetPrivate(el, node);
return el;
}

View File

@ -126,7 +126,7 @@ attributes_set_items(JSContext *ctx, JS::HandleObject hobj, void *node)
return false;
}
xmlpp::Element::AttributeList *al = static_cast<xmlpp::Element::AttributeList *>(JS_GetPrivate(hobj));
xmlpp::Element::AttributeList *al = static_cast<xmlpp::Element::AttributeList *>(JS::GetPrivate(hobj));
if (!al) {
return true;
@ -201,7 +201,7 @@ attributes_get_property_length(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Element::AttributeList *al = static_cast<xmlpp::Element::AttributeList *>(JS_GetPrivate(hobj));
xmlpp::Element::AttributeList *al = static_cast<xmlpp::Element::AttributeList *>(JS::GetPrivate(hobj));
if (!al) {
args.rval().setInt32(0);
@ -275,7 +275,7 @@ attributes_item2(JSContext *ctx, JS::HandleObject hobj, int index, JS::MutableHa
hvp.setUndefined();
xmlpp::Element::AttributeList *al = static_cast<xmlpp::Element::AttributeList *>(JS_GetPrivate(hobj));
xmlpp::Element::AttributeList *al = static_cast<xmlpp::Element::AttributeList *>(JS::GetPrivate(hobj));
if (!al) {
return true;
@ -320,7 +320,7 @@ attributes_namedItem2(JSContext *ctx, JS::HandleObject hobj, char *str, JS::Muta
return false;
}
xmlpp::Element::AttributeList *al = static_cast<xmlpp::Element::AttributeList *>(JS_GetPrivate(hobj));
xmlpp::Element::AttributeList *al = static_cast<xmlpp::Element::AttributeList *>(JS::GetPrivate(hobj));
hvp.setUndefined();
@ -364,7 +364,7 @@ getAttributes(JSContext *ctx, void *node)
JS_DefineProperties(ctx, r_el, (JSPropertySpec *) attributes_props);
spidermonkey_DefineFunctions(ctx, el, attributes_funcs);
JS_SetPrivate(el, node);
JS::SetPrivate(el, node);
attributes_set_items(ctx, r_el, node);
return el;

View File

@ -141,7 +141,7 @@ htmlCollection_get_property_length(JSContext *ctx, unsigned int argc, JS::Value
return false;
}
xmlpp::Node::NodeSet *ns = static_cast<xmlpp::Node::NodeSet *>(JS_GetPrivate(hobj));
xmlpp::Node::NodeSet *ns = static_cast<xmlpp::Node::NodeSet *>(JS::GetPrivate(hobj));
if (!ns) {
args.rval().setInt32(0);
@ -216,7 +216,7 @@ htmlCollection_item2(JSContext *ctx, JS::HandleObject hobj, int index, JS::Mutab
hvp.setUndefined();
xmlpp::Node::NodeSet *ns = static_cast<xmlpp::Node::NodeSet *>(JS_GetPrivate(hobj));
xmlpp::Node::NodeSet *ns = static_cast<xmlpp::Node::NodeSet *>(JS::GetPrivate(hobj));
if (!ns) {
return true;
@ -260,7 +260,7 @@ htmlCollection_namedItem2(JSContext *ctx, JS::HandleObject hobj, char *str, JS::
return false;
}
xmlpp::Node::NodeSet *ns = static_cast<xmlpp::Node::NodeSet *>(JS_GetPrivate(hobj));
xmlpp::Node::NodeSet *ns = static_cast<xmlpp::Node::NodeSet *>(JS::GetPrivate(hobj));
if (!ns) {
return true;
@ -316,7 +316,7 @@ htmlCollection_set_items(JSContext *ctx, JS::HandleObject hobj, void *node)
}
int counter = 0;
xmlpp::Node::NodeSet *ns = static_cast<xmlpp::Node::NodeSet *>(JS_GetPrivate(hobj));
xmlpp::Node::NodeSet *ns = static_cast<xmlpp::Node::NodeSet *>(JS::GetPrivate(hobj));
if (!ns) {
return true;
@ -373,7 +373,7 @@ getCollection(JSContext *ctx, void *node)
JS_DefineProperties(ctx, r_el, (JSPropertySpec *) htmlCollection_props);
spidermonkey_DefineFunctions(ctx, el, htmlCollection_funcs);
JS_SetPrivate(el, node);
JS::SetPrivate(el, node);
htmlCollection_set_items(ctx, r_el, node);
return el;

View File

@ -2054,7 +2054,7 @@ doctype_get_property_name(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Dtd *dtd = static_cast<xmlpp::Dtd *>(JS_GetPrivate(hobj));
xmlpp::Dtd *dtd = static_cast<xmlpp::Dtd *>(JS::GetPrivate(hobj));
if (!dtd) {
args.rval().setNull();
@ -2094,7 +2094,7 @@ doctype_get_property_publicId(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Dtd *dtd = static_cast<xmlpp::Dtd *>(JS_GetPrivate(hobj));
xmlpp::Dtd *dtd = static_cast<xmlpp::Dtd *>(JS::GetPrivate(hobj));
if (!dtd) {
args.rval().setNull();
@ -2134,7 +2134,7 @@ doctype_get_property_systemId(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Dtd *dtd = static_cast<xmlpp::Dtd *>(JS_GetPrivate(hobj));
xmlpp::Dtd *dtd = static_cast<xmlpp::Dtd *>(JS::GetPrivate(hobj));
if (!dtd) {
args.rval().setNull();
@ -2168,7 +2168,7 @@ getDoctype(JSContext *ctx, void *node)
JS::RootedObject r_el(ctx, el);
JS_DefineProperties(ctx, r_el, (JSPropertySpec *) doctype_props);
JS_SetPrivate(el, node);
JS::SetPrivate(el, node);
return el;
}
@ -2190,7 +2190,7 @@ getDocument(JSContext *ctx, void *doc)
JS_DefineProperties(ctx, r_el, (JSPropertySpec *) document_props);
spidermonkey_DefineFunctions(ctx, el, document_funcs);
JS_SetPrivate(el, doc);
JS::SetPrivate(el, doc);
return el;
}

View File

@ -198,7 +198,7 @@ element_get_property_attributes(JSContext *ctx, unsigned int argc, JS::Value *vp
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -258,7 +258,7 @@ element_get_property_children(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -334,7 +334,7 @@ element_get_property_childElementCount(JSContext *ctx, unsigned int argc, JS::Va
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -385,7 +385,7 @@ element_get_property_childNodes(JSContext *ctx, unsigned int argc, JS::Value *vp
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -445,7 +445,7 @@ element_get_property_className(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -498,7 +498,7 @@ element_get_property_dir(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -554,7 +554,7 @@ element_get_property_firstChild(JSContext *ctx, unsigned int argc, JS::Value *vp
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -613,7 +613,7 @@ element_get_property_firstElementChild(JSContext *ctx, unsigned int argc, JS::Va
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -681,7 +681,7 @@ element_get_property_id(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -733,7 +733,7 @@ element_get_property_lang(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -785,7 +785,7 @@ element_get_property_lastChild(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -843,7 +843,7 @@ element_get_property_lastElementChild(JSContext *ctx, unsigned int argc, JS::Val
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -911,7 +911,7 @@ element_get_property_nextElementSibling(JSContext *ctx, unsigned int argc, JS::V
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -979,7 +979,7 @@ element_get_property_nodeName(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Node *node = static_cast<xmlpp::Node *>(JS_GetPrivate(hobj));
xmlpp::Node *node = static_cast<xmlpp::Node *>(JS::GetPrivate(hobj));
xmlpp::ustring v;
@ -1047,7 +1047,7 @@ element_get_property_nodeType(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Node *node = static_cast<xmlpp::Node *>(JS_GetPrivate(hobj));
xmlpp::Node *node = static_cast<xmlpp::Node *>(JS::GetPrivate(hobj));
if (!node) {
args.rval().setNull();
@ -1109,7 +1109,7 @@ element_get_property_nodeValue(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Node *node = static_cast<xmlpp::Node *>(JS_GetPrivate(hobj));
xmlpp::Node *node = static_cast<xmlpp::Node *>(JS::GetPrivate(hobj));
if (!node) {
args.rval().setNull();
@ -1188,7 +1188,7 @@ element_get_property_nextSibling(JSContext *ctx, unsigned int argc, JS::Value *v
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -1290,7 +1290,7 @@ element_get_property_parentElement(JSContext *ctx, unsigned int argc, JS::Value
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -1349,7 +1349,7 @@ element_get_property_parentNode(JSContext *ctx, unsigned int argc, JS::Value *vp
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -1408,7 +1408,7 @@ element_get_property_previousElementSibling(JSContext *ctx, unsigned int argc, J
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -1476,7 +1476,7 @@ element_get_property_previousSibling(JSContext *ctx, unsigned int argc, JS::Valu
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -1535,7 +1535,7 @@ element_get_property_tagName(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -1588,7 +1588,7 @@ element_get_property_title(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -1723,7 +1723,7 @@ element_get_property_innerHtml(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -1780,7 +1780,7 @@ element_get_property_outerHtml(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -1836,7 +1836,7 @@ element_get_property_textContent(JSContext *ctx, unsigned int argc, JS::Value *v
#endif
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -1891,7 +1891,7 @@ element_set_property_className(JSContext *ctx, unsigned int argc, JS::Value *vp)
return true;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
return true;
}
@ -1940,7 +1940,7 @@ element_set_property_dir(JSContext *ctx, unsigned int argc, JS::Value *vp)
return true;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
return true;
}
@ -1993,7 +1993,7 @@ element_set_property_id(JSContext *ctx, unsigned int argc, JS::Value *vp)
return true;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
return true;
}
@ -2043,7 +2043,7 @@ element_set_property_innerHtml(JSContext *ctx, unsigned int argc, JS::Value *vp)
return true;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
return true;
}
@ -2114,7 +2114,7 @@ element_set_property_innerText(JSContext *ctx, unsigned int argc, JS::Value *vp)
return true;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
return true;
}
@ -2169,7 +2169,7 @@ element_set_property_lang(JSContext *ctx, unsigned int argc, JS::Value *vp)
return true;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
return true;
}
@ -2296,7 +2296,7 @@ element_set_property_title(JSContext *ctx, unsigned int argc, JS::Value *vp)
return true;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
return true;
}
@ -2413,7 +2413,7 @@ element_appendChild(JSContext *ctx, unsigned int argc, JS::Value *rval)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -2421,7 +2421,7 @@ element_appendChild(JSContext *ctx, unsigned int argc, JS::Value *rval)
}
JS::RootedObject node(ctx, &args[0].toObject());
xmlpp::Node *el2 = static_cast<xmlpp::Node *>(JS_GetPrivate(node));
xmlpp::Node *el2 = static_cast<xmlpp::Node *>(JS::GetPrivate(node));
el->import_node(el2);
interpreter->changed = true;
@ -2462,7 +2462,7 @@ element_cloneNode(JSContext *ctx, unsigned int argc, JS::Value *rval)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -2536,7 +2536,7 @@ element_closest(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setNull();
@ -2611,7 +2611,7 @@ element_contains(JSContext *ctx, unsigned int argc, JS::Value *rval)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setBoolean(false);
@ -2620,7 +2620,7 @@ element_contains(JSContext *ctx, unsigned int argc, JS::Value *rval)
JS::RootedObject node(ctx, &args[0].toObject());
xmlpp::Element *el2 = static_cast<xmlpp::Element *>(JS_GetPrivate(node));
xmlpp::Element *el2 = static_cast<xmlpp::Element *>(JS::GetPrivate(node));
if (!el2) {
args.rval().setBoolean(false);
@ -2661,7 +2661,7 @@ element_getAttribute(JSContext *ctx, unsigned int argc, JS::Value *rval)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setBoolean(false);
@ -2712,7 +2712,7 @@ element_getAttributeNode(JSContext *ctx, unsigned int argc, JS::Value *rval)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setUndefined();
@ -2754,7 +2754,7 @@ element_hasAttribute(JSContext *ctx, unsigned int argc, JS::Value *rval)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setBoolean(false);
@ -2792,7 +2792,7 @@ element_hasAttributes(JSContext *ctx, unsigned int argc, JS::Value *rval)
args.rval().setBoolean(false);
return true;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setBoolean(false);
@ -2826,7 +2826,7 @@ element_hasChildNodes(JSContext *ctx, unsigned int argc, JS::Value *rval)
args.rval().setBoolean(false);
return true;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setBoolean(false);
@ -2862,7 +2862,7 @@ element_insertBefore(JSContext *ctx, unsigned int argc, JS::Value *rval)
args.rval().setBoolean(false);
return true;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
return true;
@ -2871,14 +2871,14 @@ element_insertBefore(JSContext *ctx, unsigned int argc, JS::Value *rval)
JS::RootedObject next_sibling1(ctx, &args[1].toObject());
JS::RootedObject child1(ctx, &args[0].toObject());
xmlpp::Node *next_sibling = static_cast<xmlpp::Node *>(JS_GetPrivate(next_sibling1));
xmlpp::Node *next_sibling = static_cast<xmlpp::Node *>(JS::GetPrivate(next_sibling1));
if (!next_sibling) {
args.rval().setNull();
return true;
}
xmlpp::Node *child = static_cast<xmlpp::Node *>(JS_GetPrivate(child1));
xmlpp::Node *child = static_cast<xmlpp::Node *>(JS::GetPrivate(child1));
auto node = xmlAddPrevSibling(next_sibling->cobj(), child->cobj());
auto res = el_add_child_element_common(child->cobj(), node);
@ -2914,7 +2914,7 @@ element_isEqualNode(JSContext *ctx, unsigned int argc, JS::Value *rval)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setBoolean(false);
@ -2923,7 +2923,7 @@ element_isEqualNode(JSContext *ctx, unsigned int argc, JS::Value *rval)
JS::RootedObject node(ctx, &args[0].toObject());
xmlpp::Element *el2 = static_cast<xmlpp::Element *>(JS_GetPrivate(node));
xmlpp::Element *el2 = static_cast<xmlpp::Element *>(JS::GetPrivate(node));
struct string first;
struct string second;
@ -2972,7 +2972,7 @@ element_isSameNode(JSContext *ctx, unsigned int argc, JS::Value *rval)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setBoolean(false);
@ -2981,7 +2981,7 @@ element_isSameNode(JSContext *ctx, unsigned int argc, JS::Value *rval)
JS::RootedObject node(ctx, &args[0].toObject());
xmlpp::Element *el2 = static_cast<xmlpp::Element *>(JS_GetPrivate(node));
xmlpp::Element *el2 = static_cast<xmlpp::Element *>(JS::GetPrivate(node));
args.rval().setBoolean(el == el2);
return true;
@ -3008,7 +3008,7 @@ element_matches(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setBoolean(false);
@ -3065,7 +3065,7 @@ element_querySelector(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setBoolean(false);
@ -3128,7 +3128,7 @@ element_querySelectorAll(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
args.rval().setBoolean(false);
@ -3200,7 +3200,7 @@ element_remove(JSContext *ctx, unsigned int argc, JS::Value *rval)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
return true;
@ -3239,7 +3239,7 @@ element_removeChild(JSContext *ctx, unsigned int argc, JS::Value *rval)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el || !args[0].isObject()) {
args.rval().setNull();
@ -3251,7 +3251,7 @@ element_removeChild(JSContext *ctx, unsigned int argc, JS::Value *rval)
auto children = el->get_children();
auto it = children.begin();
auto end = children.end();
xmlpp::Element *el2 = static_cast<xmlpp::Element *>(JS_GetPrivate(node));
xmlpp::Element *el2 = static_cast<xmlpp::Element *>(JS::GetPrivate(node));
for (;it != end; ++it) {
if (*it == el2) {
@ -3297,7 +3297,7 @@ element_setAttribute(JSContext *ctx, unsigned int argc, JS::Value *rval)
return false;
}
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS_GetPrivate(hobj));
xmlpp::Element *el = static_cast<xmlpp::Element *>(JS::GetPrivate(hobj));
if (!el) {
return true;
@ -3331,7 +3331,7 @@ getElement(JSContext *ctx, void *node)
JS_DefineProperties(ctx, r_el, (JSPropertySpec *) element_props);
spidermonkey_DefineFunctions(ctx, el, element_funcs);
JS_SetPrivate(el, node);
JS::SetPrivate(el, node);
return el;
}

View File

@ -99,7 +99,7 @@ spidermonkey_detach_form_state(struct form_state *fs)
if (jsinput) {
// JS::RootedObject r_jsinput(spidermonkey_empty_context, jsinput);
/* This assumes JS_GetInstancePrivate and JS_SetPrivate
/* This assumes JS_GetInstancePrivate and JS::SetPrivate
* cannot GC. */
/* If this assertion fails, it is not clear whether
@ -112,7 +112,7 @@ spidermonkey_detach_form_state(struct form_state *fs)
// == fs);
// if_assert_failed {}
JS_SetPrivate(jsinput, NULL);
JS::SetPrivate(jsinput, NULL);
fs->ecmascript_obj = NULL;
}
}
@ -126,12 +126,12 @@ spidermonkey_moved_form_state(struct form_state *fs)
JSObject *jsinput = (JSObject *)fs->ecmascript_obj;
if (jsinput) {
/* This assumes JS_SetPrivate cannot GC. If it could,
/* This assumes JS::SetPrivate cannot GC. If it could,
* then the GC might call input_finalize for some
* other object whose struct form_state has also been
* reallocated, and an assertion would fail in
* input_finalize. */
JS_SetPrivate(jsinput, fs);
JS::SetPrivate(jsinput, fs);
}
}
@ -225,7 +225,7 @@ elements_finalize(JSFreeOp *op, JSObject *obj)
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
#endif
struct form_view *fv = (struct form_view *)JS_GetPrivate(obj);
struct form_view *fv = (struct form_view *)JS::GetPrivate(obj);
if (fv) {
/* If this assertion fails, leave fv->ecmascript_obj
@ -236,7 +236,7 @@ elements_finalize(JSFreeOp *op, JSObject *obj)
/// if_assert_failed return;
fv->ecmascript_obj = NULL;
/* No need to JS_SetPrivate, because the object is
/* No need to JS::SetPrivate, because the object is
* being destroyed. */
}
}
@ -810,7 +810,7 @@ form_get_property_elements(JSContext *ctx, unsigned int argc, JS::Value *vp)
JS_DefineProperties(ctx, r_jsform_elems, (JSPropertySpec *) form_elements_props);
spidermonkey_DefineFunctions(ctx, jsform_elems,
form_elements_funcs);
JS_SetPrivate(jsform_elems, fv);
JS::SetPrivate(jsform_elems, fv);
fv->ecmascript_obj = jsform_elems;
form_set_items(ctx, r_jsform_elems, fv);
@ -1411,7 +1411,7 @@ get_form_object(JSContext *ctx, JSObject *jsdoc, struct form *form)
JS::RootedObject r_jsform(ctx, jsform);
JS_DefineProperties(ctx, r_jsform, form_props);
spidermonkey_DefineFunctions(ctx, jsform, form_funcs);
JS_SetPrivate(jsform, form); /* to @form_class */
JS::SetPrivate(jsform, form); /* to @form_class */
form->ecmascript_obj = jsform;
form_set_items2(ctx, r_jsform, form);
@ -1424,7 +1424,7 @@ form_finalize(JSFreeOp *op, JSObject *jsform)
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
#endif
struct form *form = (struct form *)JS_GetPrivate(jsform);
struct form *form = (struct form *)JS::GetPrivate(jsform);
if (form) {
/* If this assertion fails, leave fv->ecmascript_obj
@ -1435,7 +1435,7 @@ form_finalize(JSFreeOp *op, JSObject *jsform)
if_assert_failed return;
form->ecmascript_obj = NULL;
/* No need to JS_SetPrivate, because the object is
/* No need to JS::SetPrivate, because the object is
* being destroyed. */
}
}
@ -1450,7 +1450,7 @@ spidermonkey_detach_form_view(struct form_view *fv)
if (jsform) {
// JS::RootedObject r_jsform(spidermonkey_empty_context, jsform);
/* This assumes JS_GetInstancePrivate and JS_SetPrivate
/* This assumes JS_GetInstancePrivate and JS::SetPrivate
* cannot GC. */
/* If this assertion fails, it is not clear whether
@ -1463,7 +1463,7 @@ spidermonkey_detach_form_view(struct form_view *fv)
// == fv);
// if_assert_failed {}
JS_SetPrivate(jsform, NULL);
JS::SetPrivate(jsform, NULL);
fv->ecmascript_obj = NULL;
}
}

View File

@ -387,7 +387,7 @@ getForms(JSContext *ctx, void *node)
JS_DefineProperties(ctx, r_el, (JSPropertySpec *) forms_props);
spidermonkey_DefineFunctions(ctx, el, forms_funcs);
JS_SetPrivate(el, node);
JS::SetPrivate(el, node);
forms_set_items(ctx, r_el, node);
return r_el;

View File

@ -1856,7 +1856,7 @@ get_input_object(JSContext *ctx, struct form_state *fs)
JS_DefineProperties(ctx, r_jsinput, (JSPropertySpec *) input_props);
spidermonkey_DefineFunctions(ctx, jsinput, input_funcs);
JS_SetPrivate(jsinput, fs); /* to @input_class */
JS::SetPrivate(jsinput, fs); /* to @input_class */
fs->ecmascript_obj = jsinput;
return jsinput;
@ -1868,7 +1868,7 @@ input_finalize(JSFreeOp *op, JSObject *jsinput)
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
#endif
struct form_state *fs = (struct form_state *)JS_GetPrivate(jsinput);
struct form_state *fs = (struct form_state *)JS::GetPrivate(jsinput);
if (fs) {
/* If this assertion fails, leave fs->ecmascript_obj
@ -1879,7 +1879,7 @@ input_finalize(JSFreeOp *op, JSObject *jsinput)
if_assert_failed return;
fs->ecmascript_obj = NULL;
/* No need to JS_SetPrivate, because jsinput is being
/* No need to JS::SetPrivate, because jsinput is being
* destroyed. */
}
}

View File

@ -137,7 +137,7 @@ nodeList_get_property_length(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false;
}
xmlpp::Node::NodeList *nl = static_cast<xmlpp::Node::NodeList *>(JS_GetPrivate(hobj));
xmlpp::Node::NodeList *nl = static_cast<xmlpp::Node::NodeList *>(JS::GetPrivate(hobj));
if (!nl) {
args.rval().setInt32(0);
@ -190,7 +190,7 @@ nodeList_item2(JSContext *ctx, JS::HandleObject hobj, int index, JS::MutableHand
hvp.setUndefined();
xmlpp::Node::NodeList *nl = static_cast<xmlpp::Node::NodeList *>(JS_GetPrivate(hobj));
xmlpp::Node::NodeList *nl = static_cast<xmlpp::Node::NodeList *>(JS::GetPrivate(hobj));
if (!nl) {
return true;
@ -241,7 +241,7 @@ nodeList_set_items(JSContext *ctx, JS::HandleObject hobj, void *node)
#endif
return false;
}
xmlpp::Node::NodeList *nl = static_cast<xmlpp::Node::NodeList *>(JS_GetPrivate(hobj));
xmlpp::Node::NodeList *nl = static_cast<xmlpp::Node::NodeList *>(JS::GetPrivate(hobj));
if (!nl) {
return true;
@ -286,7 +286,7 @@ getNodeList(JSContext *ctx, void *node)
JS_DefineProperties(ctx, r_el, (JSPropertySpec *) nodeList_props);
spidermonkey_DefineFunctions(ctx, el, nodeList_funcs);
JS_SetPrivate(el, node);
JS::SetPrivate(el, node);
nodeList_set_items(ctx, r_el, node);
return el;

View File

@ -163,7 +163,7 @@ unibar_get_property_visible(JSContext *ctx, unsigned int argc, JS::Value *vp)
}
doc_view = vs->doc_view;
status = &doc_view->session->status;
bar = (char *)JS_GetPrivate(hobj); /* from @menubar_class or @statusbar_class */
bar = (char *)JS::GetPrivate(hobj); /* from @menubar_class or @statusbar_class */
#define unibar_fetch(bar) \
status->force_show_##bar##_bar >= 0 \
@ -229,7 +229,7 @@ unibar_set_property_visible(JSContext *ctx, unsigned int argc, JS::Value *vp)
}
doc_view = vs->doc_view;
status = &doc_view->session->status;
bar = (char *)JS_GetPrivate(hobj); /* from @menubar_class or @statusbar_class */
bar = (char *)JS::GetPrivate(hobj); /* from @menubar_class or @statusbar_class */
switch (*bar) {
case 's':

View File

@ -57,7 +57,7 @@ smjs_action_fn_finalize(JSFreeOp *op, JSObject *obj)
(JSClass *) &action_fn_class, NULL);
#endif
hop = (struct smjs_action_fn_callback_hop *)JS_GetPrivate(obj);
hop = (struct smjs_action_fn_callback_hop *)JS::GetPrivate(obj);
mem_free_if(hop);
}
@ -153,7 +153,7 @@ smjs_get_action_fn_object(char *action_str)
hop->action_id = get_action_from_string(KEYMAP_MAIN, action_str);
if (-1 != hop->action_id) {
JS_SetPrivate(obj, hop); /* to @action_fn_class */
JS::SetPrivate(obj, hop); /* to @action_fn_class */
return obj;
}

View File

@ -69,7 +69,7 @@ smjs_get_bookmark_generic_object(struct bookmark *bookmark, JSClass *clasp)
if (!bookmark) return jsobj;
JS_SetPrivate(jsobj, bookmark); /* to @bookmark_class or @bookmark_folder_class */
JS::SetPrivate(jsobj, bookmark); /* to @bookmark_class or @bookmark_folder_class */
object_lock(bookmark);
return jsobj;
@ -86,7 +86,7 @@ bookmark_finalize(JSFreeOp *op, JSObject *obj)
if_assert_failed return;
#endif
bookmark = (struct bookmark *)JS_GetPrivate(obj); /* from @bookmark_class or @bookmark_folder_class */
bookmark = (struct bookmark *)JS::GetPrivate(obj); /* from @bookmark_class or @bookmark_folder_class */
if (bookmark) object_unlock(bookmark);
}

View File

@ -234,11 +234,11 @@ cache_entry_finalize(JSFreeOp *op, JSObject *obj)
if_assert_failed return;
#endif
cached = (struct cache_entry *)JS_GetPrivate(obj);
cached = (struct cache_entry *)JS::GetPrivate(obj);
if (!cached) return; /* already detached */
JS_SetPrivate(obj, NULL); /* perhaps not necessary */
JS::SetPrivate(obj, NULL); /* perhaps not necessary */
assert(cached->jsobject == obj);
if_assert_failed return;
cached->jsobject = NULL;
@ -275,7 +275,7 @@ smjs_get_cache_entry_object(struct cache_entry *cached)
/* Do this last, so that if any previous step fails, we can
* just forget the object and its finalizer won't attempt to
* access @cached. */
JS_SetPrivate(cache_entry_object, cached); /* to @cache_entry_class */
JS::SetPrivate(cache_entry_object, cached); /* to @cache_entry_class */
cached->jsobject = cache_entry_object;
return cache_entry_object;
}
@ -301,7 +301,7 @@ smjs_detach_cache_entry_object(struct cache_entry *cached)
== cached);
if_assert_failed {}
JS_SetPrivate(cached->jsobject, NULL);
JS::SetPrivate(cached->jsobject, NULL);
cached->jsobject = NULL;
}

View File

@ -49,7 +49,7 @@ error_reporter(JSContext *ctx, JSErrorReport *report)
if (f) {
struct string msg;
JS::PrintError(ctx, f, report, true/*reportWarnings*/);
JS::PrintError(f, report, true/*reportWarnings*/);
fclose(f);
if (!init_string(&msg)) {

View File

@ -47,7 +47,7 @@ smjs_globhist_item_finalize(JSFreeOp *op, JSObject *obj)
if_assert_failed return;
#endif
history_item = (struct global_history_item *)JS_GetPrivate(obj);
history_item = (struct global_history_item *)JS::GetPrivate(obj);
if (history_item) object_unlock(history_item);
}
@ -80,7 +80,7 @@ smjs_get_globhist_item_object(struct global_history_item *history_item)
(JSPropertySpec *) smjs_globhist_item_props)) {
return NULL;
}
JS_SetPrivate(jsobj, history_item); /* to @smjs_globhist_item_class */
JS::SetPrivate(jsobj, history_item); /* to @smjs_globhist_item_class */
object_lock(history_item);
return jsobj;