1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

SEE: do not do check_class for alert, open and setTimeout.

Do not do check_class when functions called by the global object.
This commit is contained in:
Witold Filipczyk 2007-04-14 23:32:14 +02:00 committed by Witold Filipczyk
parent 182812352b
commit cd982d7d65

View File

@ -211,7 +211,8 @@ js_window_alert(struct SEE_interpreter *interp, struct SEE_object *self,
struct view_state *vs = win->vs;
unsigned char *string;
see_check_class(interp, thisobj, &js_window_object_class);
if (thisobj != interp->Global)
see_check_class(interp, thisobj, &js_window_object_class);
SEE_SET_BOOLEAN(res, 1);
if (argc < 1)
@ -248,7 +249,8 @@ js_window_open(struct SEE_interpreter *interp, struct SEE_object *self,
static int ratelimit_count;
#endif
see_check_class(interp, thisobj, &js_window_object_class);
if (thisobj != interp->Global)
see_check_class(interp, thisobj, &js_window_object_class);
SEE_SET_OBJECT(res, (struct SEE_object *)win);
if (get_opt_bool("ecmascript.block_window_opening")) {
@ -341,7 +343,8 @@ js_setTimeout(struct SEE_interpreter *interp, struct SEE_object *self,
unsigned char *code;
int timeout;
see_check_class(interp, thisobj, &js_window_object_class);
if (thisobj != interp->Global)
see_check_class(interp, thisobj, &js_window_object_class);
if (argc != 2) return;
ei = ((struct global_object *)interp)->interpreter;