mirror of
https://github.com/rkd77/elinks.git
synced 2025-06-30 22:19:29 -04:00
SEE: Do not check thisobj->objectclass in window functions.
init_js_window_object() copies the alert, open, and setTimeout methods from the window object to the global object. My fix for bug 846 on 2006-12-10 incorrectly made the corresponding C functions refuse to work if they were not called as methods of the window object.
This commit is contained in:
parent
39a5d68447
commit
85bfba4530
3
NEWS
3
NEWS
@ -36,6 +36,9 @@ Bugs that should be removed from NEWS before the 0.12.0 release:
|
|||||||
was the first release that had these bugs.
|
was the first release that had these bugs.
|
||||||
* bug 1033: Fix memory leak in ECMAScript window.open. ELinks 0.12pre1
|
* bug 1033: Fix memory leak in ECMAScript window.open. ELinks 0.12pre1
|
||||||
was the first release that had this bug.
|
was the first release that had this bug.
|
||||||
|
* Global ECMAScript functions alert, open, and setTimeout again work
|
||||||
|
with SEE. ELinks 0.12pre1 was the first release that supported SEE
|
||||||
|
at all.
|
||||||
|
|
||||||
ELinks 0.12pre1:
|
ELinks 0.12pre1:
|
||||||
----------------
|
----------------
|
||||||
|
@ -211,7 +211,9 @@ js_window_alert(struct SEE_interpreter *interp, struct SEE_object *self,
|
|||||||
struct view_state *vs = win->vs;
|
struct view_state *vs = win->vs;
|
||||||
unsigned char *string;
|
unsigned char *string;
|
||||||
|
|
||||||
see_check_class(interp, thisobj, &js_window_object_class);
|
/* Do not check thisobj->objectclass. ELinks sets this
|
||||||
|
* function as a property of both the window object and the
|
||||||
|
* global object, so thisobj may validly refer to either. */
|
||||||
|
|
||||||
SEE_SET_BOOLEAN(res, 1);
|
SEE_SET_BOOLEAN(res, 1);
|
||||||
if (argc < 1)
|
if (argc < 1)
|
||||||
@ -248,7 +250,9 @@ js_window_open(struct SEE_interpreter *interp, struct SEE_object *self,
|
|||||||
static int ratelimit_count;
|
static int ratelimit_count;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
see_check_class(interp, thisobj, &js_window_object_class);
|
/* Do not check thisobj->objectclass. ELinks sets this
|
||||||
|
* function as a property of both the window object and the
|
||||||
|
* global object, so thisobj may validly refer to either. */
|
||||||
|
|
||||||
SEE_SET_OBJECT(res, (struct SEE_object *)win);
|
SEE_SET_OBJECT(res, (struct SEE_object *)win);
|
||||||
if (get_opt_bool("ecmascript.block_window_opening")) {
|
if (get_opt_bool("ecmascript.block_window_opening")) {
|
||||||
@ -342,7 +346,9 @@ js_setTimeout(struct SEE_interpreter *interp, struct SEE_object *self,
|
|||||||
unsigned char *code;
|
unsigned char *code;
|
||||||
int timeout;
|
int timeout;
|
||||||
|
|
||||||
see_check_class(interp, thisobj, &js_window_object_class);
|
/* Do not check thisobj->objectclass. ELinks sets this
|
||||||
|
* function as a property of both the window object and the
|
||||||
|
* global object, so thisobj may validly refer to either. */
|
||||||
|
|
||||||
if (argc != 2) return;
|
if (argc != 2) return;
|
||||||
ei = ((struct global_object *)interp)->interpreter;
|
ei = ((struct global_object *)interp)->interpreter;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user