mirror of
https://github.com/rkd77/elinks.git
synced 2024-09-30 03:26:23 -04:00
[spidermonkey] Declare str earlier
This commit is contained in:
parent
80e2b6b812
commit
7cf2be2db7
@ -867,6 +867,7 @@ document_get_property_referrer(JSContext *ctx, unsigned int argc, JS::Value *vp)
|
|||||||
struct document_view *doc_view;
|
struct document_view *doc_view;
|
||||||
struct document *document;
|
struct document *document;
|
||||||
struct session *ses;
|
struct session *ses;
|
||||||
|
char *str;
|
||||||
|
|
||||||
vs = interpreter->vs;
|
vs = interpreter->vs;
|
||||||
|
|
||||||
@ -893,7 +894,7 @@ document_get_property_referrer(JSContext *ctx, unsigned int argc, JS::Value *vp)
|
|||||||
case REFERER_TRUE:
|
case REFERER_TRUE:
|
||||||
/* XXX: Encode as in add_url_to_httset_prop_string(&prop, ) ? --pasky */
|
/* XXX: Encode as in add_url_to_httset_prop_string(&prop, ) ? --pasky */
|
||||||
if (ses->referrer) {
|
if (ses->referrer) {
|
||||||
char *str = get_uri_string(ses->referrer, URI_HTTP_REFERRER);
|
str = get_uri_string(ses->referrer, URI_HTTP_REFERRER);
|
||||||
|
|
||||||
if (str) {
|
if (str) {
|
||||||
args.rval().setString(JS_NewStringCopyZ(ctx, str));
|
args.rval().setString(JS_NewStringCopyZ(ctx, str));
|
||||||
@ -905,7 +906,7 @@ document_get_property_referrer(JSContext *ctx, unsigned int argc, JS::Value *vp)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case REFERER_SAME_URL:
|
case REFERER_SAME_URL:
|
||||||
char *str = get_uri_string(document->uri, URI_HTTP_REFERRER);
|
str = get_uri_string(document->uri, URI_HTTP_REFERRER);
|
||||||
|
|
||||||
if (str) {
|
if (str) {
|
||||||
args.rval().setString(JS_NewStringCopyZ(ctx, str));
|
args.rval().setString(JS_NewStringCopyZ(ctx, str));
|
||||||
|
Loading…
Reference in New Issue
Block a user