1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-04-18 00:47:36 -04:00

Make SpiderMonkey consistent with SEE. Do not cache ecmascript_objs

This commit is contained in:
2006-01-30 11:15:04 +01:00
parent 44710bb1e9
commit b4d9b7f5a6

View File

@ -385,17 +385,19 @@ input_select(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
static JSObject * static JSObject *
get_input_object(JSContext *ctx, JSObject *jsform, struct form_state *fs) get_input_object(JSContext *ctx, JSObject *jsform, struct form_state *fs)
{ {
if (!fs->ecmascript_obj) { #if 0
/* jsform ('form') is input's parent */ if (fs->ecmascript_obj)
/* FIXME: That is NOT correct since the real containing element return fs->ecmascript_obj;
* should be its parent, but gimme DOM first. --pasky */ #endif
JSObject *jsinput = JS_NewObject(ctx, (JSClass *) &input_class, NULL, jsform); /* jsform ('form') is input's parent */
/* FIXME: That is NOT correct since the real containing element
* should be its parent, but gimme DOM first. --pasky */
JSObject *jsinput = JS_NewObject(ctx, (JSClass *) &input_class, NULL, jsform);
JS_DefineProperties(ctx, jsinput, (JSPropertySpec *) input_props); JS_DefineProperties(ctx, jsinput, (JSPropertySpec *) input_props);
JS_DefineFunctions(ctx, jsinput, (JSFunctionSpec *) input_funcs); JS_DefineFunctions(ctx, jsinput, (JSFunctionSpec *) input_funcs);
JS_SetPrivate(ctx, jsinput, fs); JS_SetPrivate(ctx, jsinput, fs);
fs->ecmascript_obj = jsinput; fs->ecmascript_obj = jsinput;
}
return fs->ecmascript_obj; return fs->ecmascript_obj;
} }
@ -815,17 +817,19 @@ form_submit(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
JSObject * JSObject *
get_form_object(JSContext *ctx, JSObject *jsdoc, struct form_view *fv) get_form_object(JSContext *ctx, JSObject *jsdoc, struct form_view *fv)
{ {
if (!fv->ecmascript_obj) { #if 0
/* jsdoc ('document') is fv's parent */ if (fv->ecmascript_obj)
/* FIXME: That is NOT correct since the real containing element return fv->ecmascript_obj;
* should be its parent, but gimme DOM first. --pasky */ #endif
JSObject *jsform = JS_NewObject(ctx, (JSClass *) &form_class, NULL, jsdoc); /* jsdoc ('document') is fv's parent */
/* FIXME: That is NOT correct since the real containing element
* should be its parent, but gimme DOM first. --pasky */
JSObject *jsform = JS_NewObject(ctx, (JSClass *) &form_class, NULL, jsdoc);
JS_DefineProperties(ctx, jsform, (JSPropertySpec *) form_props); JS_DefineProperties(ctx, jsform, (JSPropertySpec *) form_props);
JS_DefineFunctions(ctx, jsform, (JSFunctionSpec *) form_funcs); JS_DefineFunctions(ctx, jsform, (JSFunctionSpec *) form_funcs);
JS_SetPrivate(ctx, jsform, fv); JS_SetPrivate(ctx, jsform, fv);
fv->ecmascript_obj = jsform; fv->ecmascript_obj = jsform;
}
return fv->ecmascript_obj; return fv->ecmascript_obj;
} }