1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

[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 || if test "x$CONFIG_SPIDERMONKEY" = xyes ||
test "x$CONFIG_SCRIPTING_SPIDERMONKEY" = xyes; then test "x$CONFIG_SCRIPTING_SPIDERMONKEY" = xyes; then
package=mozjs-78 package=mozjs-91
AC_MSG_CHECKING([for SpiderMonkey (mozjs-78) in pkg-config $package]) 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 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)" DB_LOCALSTORAGE_LIBS="$($PKG_CONFIG $pkg_config_static --libs sqlite3)"
XMLPLUSPLUS_LIBS="$($PKG_CONFIG $pkg_config_static --libs libxml++-5.0)" XMLPLUSPLUS_LIBS="$($PKG_CONFIG $pkg_config_static --libs libxml++-5.0)"

View File

@ -379,7 +379,7 @@ if conf_data.get('CONFIG_BZIP2')
endif endif
if conf_data.get('CONFIG_ECMASCRIPT_SMJS') or conf_data.get('CONFIG_SCRIPTING_SPIDERMONKEY') 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 deps += mozjsdeps
endif endif

View File

@ -104,7 +104,7 @@ error_reporter(JSContext *ctx, JSErrorReport *report)
f = open_memstream(&ptr, &size); f = open_memstream(&ptr, &size);
if (f) { if (f) {
JS::PrintError(ctx, f, report, true/*reportWarnings*/); JS::PrintError(f, report, true/*reportWarnings*/);
fclose(f); fclose(f);
if (!init_string(&msg)) { if (!init_string(&msg)) {
@ -242,7 +242,7 @@ spidermonkey_get_interpreter(struct ecmascript_interpreter *interpreter)
if (!menubar_obj) { if (!menubar_obj) {
goto release_and_fail; 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_obj = JS_InitClass(ctx, window_obj, nullptr,
&statusbar_class, NULL, 0, &statusbar_class, NULL, 0,
@ -251,7 +251,7 @@ spidermonkey_get_interpreter(struct ecmascript_interpreter *interpreter)
if (!statusbar_obj) { if (!statusbar_obj) {
goto release_and_fail; 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_obj = JS_InitClass(ctx, window_obj, nullptr,
&navigator_class, NULL, 0, &navigator_class, NULL, 0,
@ -318,7 +318,7 @@ spidermonkey_check_for_exception(JSContext *ctx) {
* Undefined and with line 0. Let's filter this. */ * Undefined and with line 0. Let's filter this. */
/* Optional printing javascript error to file */ /* Optional printing javascript error to file */
//FILE *f = fopen("js.err","a"); //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 */ /* Send the error to the tui */
error_reporter(ctx, report); error_reporter(ctx, report);
//DBG("file: %s",report->filename); //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; return false;
} }
xmlpp::AttributeNode *attr = static_cast<xmlpp::AttributeNode *>(JS_GetPrivate(hobj)); xmlpp::AttributeNode *attr = static_cast<xmlpp::AttributeNode *>(JS::GetPrivate(hobj));
if (!attr) { if (!attr) {
args.rval().setNull(); args.rval().setNull();
@ -182,7 +182,7 @@ attr_get_property_value(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false; return false;
} }
xmlpp::AttributeNode *attr = static_cast<xmlpp::AttributeNode *>(JS_GetPrivate(hobj)); xmlpp::AttributeNode *attr = static_cast<xmlpp::AttributeNode *>(JS::GetPrivate(hobj));
if (!attr) { if (!attr) {
args.rval().setNull(); args.rval().setNull();
@ -209,7 +209,7 @@ getAttr(JSContext *ctx, void *node)
JS_DefineProperties(ctx, r_el, (JSPropertySpec *) attr_props); JS_DefineProperties(ctx, r_el, (JSPropertySpec *) attr_props);
// spidermonkey_DefineFunctions(ctx, el, attributes_funcs); // spidermonkey_DefineFunctions(ctx, el, attributes_funcs);
JS_SetPrivate(el, node); JS::SetPrivate(el, node);
return el; return el;
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -137,7 +137,7 @@ nodeList_get_property_length(JSContext *ctx, unsigned int argc, JS::Value *vp)
return false; 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) { if (!nl) {
args.rval().setInt32(0); args.rval().setInt32(0);
@ -190,7 +190,7 @@ nodeList_item2(JSContext *ctx, JS::HandleObject hobj, int index, JS::MutableHand
hvp.setUndefined(); 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) { if (!nl) {
return true; return true;
@ -241,7 +241,7 @@ nodeList_set_items(JSContext *ctx, JS::HandleObject hobj, void *node)
#endif #endif
return false; 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) { if (!nl) {
return true; return true;
@ -286,7 +286,7 @@ getNodeList(JSContext *ctx, void *node)
JS_DefineProperties(ctx, r_el, (JSPropertySpec *) nodeList_props); JS_DefineProperties(ctx, r_el, (JSPropertySpec *) nodeList_props);
spidermonkey_DefineFunctions(ctx, el, nodeList_funcs); spidermonkey_DefineFunctions(ctx, el, nodeList_funcs);
JS_SetPrivate(el, node); JS::SetPrivate(el, node);
nodeList_set_items(ctx, r_el, node); nodeList_set_items(ctx, r_el, node);
return el; 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; doc_view = vs->doc_view;
status = &doc_view->session->status; 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) \ #define unibar_fetch(bar) \
status->force_show_##bar##_bar >= 0 \ 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; doc_view = vs->doc_view;
status = &doc_view->session->status; 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) { switch (*bar) {
case 's': case 's':

View File

@ -57,7 +57,7 @@ smjs_action_fn_finalize(JSFreeOp *op, JSObject *obj)
(JSClass *) &action_fn_class, NULL); (JSClass *) &action_fn_class, NULL);
#endif #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); 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); hop->action_id = get_action_from_string(KEYMAP_MAIN, action_str);
if (-1 != hop->action_id) { if (-1 != hop->action_id) {
JS_SetPrivate(obj, hop); /* to @action_fn_class */ JS::SetPrivate(obj, hop); /* to @action_fn_class */
return obj; return obj;
} }

View File

@ -69,7 +69,7 @@ smjs_get_bookmark_generic_object(struct bookmark *bookmark, JSClass *clasp)
if (!bookmark) return jsobj; 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); object_lock(bookmark);
return jsobj; return jsobj;
@ -86,7 +86,7 @@ bookmark_finalize(JSFreeOp *op, JSObject *obj)
if_assert_failed return; if_assert_failed return;
#endif #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); if (bookmark) object_unlock(bookmark);
} }

View File

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

View File

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

View File

@ -47,7 +47,7 @@ smjs_globhist_item_finalize(JSFreeOp *op, JSObject *obj)
if_assert_failed return; if_assert_failed return;
#endif #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); 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)) { (JSPropertySpec *) smjs_globhist_item_props)) {
return NULL; 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); object_lock(history_item);
return jsobj; return jsobj;

View File

@ -208,7 +208,7 @@ keymap_finalize(JSFreeOp *op, JSObject *obj)
if_assert_failed return; if_assert_failed return;
#endif #endif
data = JS_GetPrivate(obj); data = JS::GetPrivate(obj);
mem_free(data); mem_free(data);
} }
@ -228,7 +228,7 @@ smjs_get_keymap_object(keymap_id_T keymap_id)
data = intdup(keymap_id); data = intdup(keymap_id);
if (!data) return NULL; if (!data) return NULL;
JS_SetPrivate(keymap_object, data); /* to @keymap_class */ JS::SetPrivate(keymap_object, data); /* to @keymap_class */
return keymap_object; return keymap_object;
} }

View File

@ -147,11 +147,11 @@ smjs_location_array_finalize(JSFreeOp *op, JSObject *obj)
if_assert_failed return; if_assert_failed return;
#endif #endif
ses = (struct session *)JS_GetPrivate(obj); ses = (struct session *)JS::GetPrivate(obj);
if (!ses) return; /* already detached */ if (!ses) return; /* already detached */
JS_SetPrivate(obj, NULL); /* perhaps not necessary */ JS::SetPrivate(obj, NULL); /* perhaps not necessary */
assert(ses->history_jsobject == obj); assert(ses->history_jsobject == obj);
if_assert_failed return; if_assert_failed return;
ses->history_jsobject = NULL; ses->history_jsobject = NULL;
@ -177,7 +177,7 @@ smjs_get_session_location_array_object(struct session *ses)
/* Do this last, so that if any previous step fails, we can /* Do this last, so that if any previous step fails, we can
* just forget the object and its finalizer won't attempt to * just forget the object and its finalizer won't attempt to
* access @ses. */ * access @ses. */
JS_SetPrivate(obj, ses); JS::SetPrivate(obj, ses);
ses->history_jsobject = obj; ses->history_jsobject = obj;
return obj; return obj;
@ -946,11 +946,11 @@ session_finalize(JSFreeOp *op, JSObject *obj)
if_assert_failed return; if_assert_failed return;
#endif #endif
ses = (struct session *)JS_GetPrivate(obj); ses = (struct session *)JS::GetPrivate(obj);
if (!ses) return; /* already detached */ if (!ses) return; /* already detached */
JS_SetPrivate(obj, NULL); /* perhaps not necessary */ JS::SetPrivate(obj, NULL); /* perhaps not necessary */
assert(ses->jsobject == obj); assert(ses->jsobject == obj);
if_assert_failed return; if_assert_failed return;
ses->jsobject = NULL; ses->jsobject = NULL;
@ -982,7 +982,7 @@ smjs_get_session_object(struct session *ses)
/* Do this last, so that if any previous step fails, we can /* Do this last, so that if any previous step fails, we can
* just forget the object and its finalizer won't attempt to * just forget the object and its finalizer won't attempt to
* access @ses. */ * access @ses. */
JS_SetPrivate(obj, ses); /* to @session_class */ JS::SetPrivate(obj, ses); /* to @session_class */
ses->jsobject = obj; ses->jsobject = obj;
return obj; return obj;
@ -1006,7 +1006,7 @@ smjs_detach_session_object(struct session *ses)
== ses); == ses);
if_assert_failed {} if_assert_failed {}
JS_SetPrivate(ses->jsobject, NULL); JS::SetPrivate(ses->jsobject, NULL);
ses->jsobject = NULL; ses->jsobject = NULL;
} }
@ -1019,7 +1019,7 @@ smjs_detach_session_object(struct session *ses)
== ses); == ses);
if_assert_failed {} if_assert_failed {}
JS_SetPrivate(ses->history_jsobject, NULL); JS::SetPrivate(ses->history_jsobject, NULL);
ses->history_jsobject = NULL; ses->history_jsobject = NULL;
} }
} }
@ -1036,7 +1036,7 @@ session_array_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId h
ELINKS_CAST_PROP_PARAMS ELINKS_CAST_PROP_PARAMS
JSObject *tabobj; JSObject *tabobj;
struct terminal *term = (struct terminal *)JS_GetPrivate(obj); struct terminal *term = (struct terminal *)JS::GetPrivate(obj);
int index; int index;
struct window *tab; struct window *tab;
@ -1094,7 +1094,7 @@ smjs_get_session_array_object(struct terminal *term)
obj = JS_NewObject(smjs_ctx, (JSClass *) &session_array_class); obj = JS_NewObject(smjs_ctx, (JSClass *) &session_array_class);
if (!obj) return NULL; if (!obj) return NULL;
JS_SetPrivate(obj, term); JS::SetPrivate(obj, term);
return obj; return obj;
} }
@ -1118,7 +1118,7 @@ smjs_detach_session_array_object(struct terminal *term)
== term); == term);
if_assert_failed {} if_assert_failed {}
JS_SetPrivate(term->session_array_jsobject, NULL); JS::SetPrivate(term->session_array_jsobject, NULL);
term->session_array_jsobject = NULL; term->session_array_jsobject = NULL;
} }

View File

@ -86,11 +86,11 @@ terminal_finalize(JSFreeOp *op, JSObject *obj)
assert(JS_InstanceOf(ctx, obj, (JSClass *) &terminal_class, NULL)); assert(JS_InstanceOf(ctx, obj, (JSClass *) &terminal_class, NULL));
if_assert_failed return; if_assert_failed return;
#endif #endif
term = (struct terminal *)JS_GetPrivate(obj); term = (struct terminal *)JS::GetPrivate(obj);
if (!term) return; /* already detached */ if (!term) return; /* already detached */
JS_SetPrivate(obj, NULL); /* perhaps not necessary */ JS::SetPrivate(obj, NULL); /* perhaps not necessary */
assert(term->jsobject == obj); assert(term->jsobject == obj);
if_assert_failed return; if_assert_failed return;
term->jsobject = NULL; term->jsobject = NULL;
@ -122,7 +122,7 @@ smjs_get_terminal_object(struct terminal *term)
/* Do this last, so that if any previous step fails, we can /* Do this last, so that if any previous step fails, we can
* just forget the object and its finalizer won't attempt to * just forget the object and its finalizer won't attempt to
* access @cached. */ * access @cached. */
JS_SetPrivate(obj, term); /* to @terminal_class */ JS::SetPrivate(obj, term); /* to @terminal_class */
term->jsobject = obj; term->jsobject = obj;
return obj; return obj;
@ -150,7 +150,7 @@ smjs_detach_terminal_object(struct terminal *term)
== term); == term);
if_assert_failed {} if_assert_failed {}
JS_SetPrivate(term->jsobject, NULL); JS::SetPrivate(term->jsobject, NULL);
term->jsobject = NULL; term->jsobject = NULL;
} }

View File

@ -147,13 +147,13 @@ view_state_finalize(JSFreeOp *op, JSObject *obj)
(JSClass *) &view_state_class, NULL); (JSClass *) &view_state_class, NULL);
#endif #endif
vs = (struct view_state *)JS_GetPrivate(obj); vs = (struct view_state *)JS::GetPrivate(obj);
if (!vs) return; /* already detached */ if (!vs) return; /* already detached */
assert(vs->jsobject == obj); assert(vs->jsobject == obj);
if_assert_failed return; if_assert_failed return;
JS_SetPrivate(obj, NULL); /* perhaps not necessary */ JS::SetPrivate(obj, NULL); /* perhaps not necessary */
vs->jsobject = NULL; vs->jsobject = NULL;
} }
@ -185,7 +185,7 @@ smjs_get_view_state_object(struct view_state *vs)
* just forget the object and its finalizer won't attempt to * just forget the object and its finalizer won't attempt to
* access @vs. */ * access @vs. */
JS_SetPrivate(view_state_object, vs); /* to @view_state_class */ JS::SetPrivate(view_state_object, vs); /* to @view_state_class */
vs->jsobject = view_state_object; vs->jsobject = view_state_object;
return view_state_object; return view_state_object;
@ -235,7 +235,7 @@ smjs_detach_view_state_object(struct view_state *vs)
if_assert_failed return; if_assert_failed return;
JS_SetPrivate(vs->jsobject, NULL); JS::SetPrivate(vs->jsobject, NULL);
vs->jsobject = NULL; vs->jsobject = NULL;
} }