1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-07-01 02:05:33 +00:00
Commit Graph

353 Commits

Author SHA1 Message Date
Witold Filipczyk
acae461bf8 [lua] more const 2022-01-30 17:34:36 +01:00
Witold Filipczyk
b5c4addbbe [lua] do_hooks_file const 2022-01-30 15:55:54 +01:00
Witold Filipczyk
e44f1f6490 [lua] const in alert_lua_error 2022-01-30 15:39:26 +01:00
Witold Filipczyk
c130f96452 [python] another way to avoid warnings 2022-01-29 12:21:13 +01:00
Witold Filipczyk
386a0f956f [python] compilation fixes 2022-01-29 12:08:30 +01:00
Witold Filipczyk
89952dfec4 [lua] cast 2022-01-29 11:18:56 +01:00
Witold Filipczyk
ee6e9caa6a [kbd] enum keymap_id -> keymap_id_T 2022-01-28 14:20:06 +01:00
Witold Filipczyk
53a860a3d6 [strchr] casting first parameter to const char * was not a good idea 2022-01-18 20:30:48 +01:00
Witold Filipczyk
b914dddeee [mem_alloc] oversight 2022-01-16 21:17:36 +01:00
Witold Filipczyk
881f896e85 [mem_calloc] Cast 2022-01-16 21:08:50 +01:00
Witold Filipczyk
be8a030fa7 [mem_realloc] cast return value 2022-01-16 19:38:30 +01:00
Witold Filipczyk
20c161559c [mem_alloc] cast return value 2022-01-16 19:09:27 +01:00
Witold Filipczyk
1e365c9798 [ruby] #undef _GNU_SOURCE (warnings) 2022-01-15 17:56:00 +01:00
Witold Filipczyk
0e8ee7876a [uri] 0 -> URI_NONE in get_uri to decrease number of warnings 2022-01-14 20:52:17 +01:00
Witold Filipczyk
350c6a2cf0 [guile] version 2022-01-08 18:08:12 +01:00
Witold Filipczyk
15d97cae07 [ruby] Show version 2022-01-07 18:59:22 +01:00
Witold Filipczyk
8efb3b8a76 [python] Show Python version 2022-01-07 18:43:21 +01:00
Witold Filipczyk
d302b29d22 [perl] Show version 2022-01-07 18:35:15 +01:00
Witold Filipczyk
0d5dbbd148 [lua] Show lua version in About dialog 2022-01-07 18:22:05 +01:00
Witold Filipczyk
88aa2f9e0e [lua] casting to char * 2021-12-20 16:39:08 +01:00
Witold Filipczyk
aa586ee999 [python] set program name 2021-12-14 16:41:59 +01:00
Witold Filipczyk
b77d4d8395 [ruby] Changed declaration of missing_method 2021-12-12 15:07:49 +01:00
Witold Filipczyk
155cc0c005 [perl] Compilation fix when compiled --with-perl --disable-nls 2021-12-05 15:38:26 +01:00
Olivier El Mekki
edaf66fc60
[lua] expose reload() and goto_url() to lua api
Two api methods for lua scripting has been added.

`reload()` allows to refresh the document without triggering a new
html request. This commits expose that existing internal function to the
lua api.

One example where it is useful : making a lua hook that allows to edit a
local file we're browsing and see the change without having to perform a
full reload (thus losing the scrolling position). Or anything else that
allows to interactively modify the currently loaded document.

`goto_url()` allows to navigate to given url long after the page has been
loaded (so follow_url_hooks can't be used).

Example where it's useful : binding a key to load the latest archive.org
snapshot for current page (especially useful when using tor and being
constantly harassed by cloudflare).
2021-11-13 13:57:52 +01:00
Witold Filipczyk
30d4eb36ff [smjs] Error Reporting with open_memstream 2021-09-06 20:36:10 +02:00
Witold Filipczyk
024f4f44b6 [smjs] Report errors to stderr 2021-09-06 19:46:09 +02:00
Witold Filipczyk
f692389917 [smjs] Compilation fixes. 2021-09-05 17:50:41 +02:00
Witold Filipczyk
47224921de [spidermonkey] jsval_to_string everywhere
Replace JS_EncodeString by jsval_to_string. It will allow easier
changes in the future. In smjs nullptr everywhere.
In ecmascript arrays don't work. For example
document.getElementsByTagName("H1")[0]

smjs even does not start.

Plan is to bump mozjs version, and later back to fixing bugs.
2021-08-27 19:46:05 +02:00
Witold Filipczyk
630696da59 [smjs] nullptr for ClassOps 2021-08-26 18:39:03 +02:00
Witold Filipczyk
34e878a0da [ecmascript] nullptr everywhere 2021-08-26 15:44:32 +02:00
Witold Filipczyk
b825f4abf1 [js] Start to adjust code for mozjs-60. 2021-08-25 20:08:02 +02:00
Witold Filipczyk
ee49c80061 [meson] ruby dependency: ruby not ruby-2.6
Also initialize error, because rb_load_protect, does not change it.
2021-08-17 16:09:05 +02:00
Witold Filipczyk
66305fcb50 [gettext] try system gettext. Refs #62
Now, only meson was changed.
-Dnls=true -Dgettext=true
2021-08-08 21:25:08 +02:00
Witold Filipczyk
73c632f00c [lua] called tempname. 2021-04-03 21:14:21 +02:00
Witold Filipczyk
f351fbcf6a [dump] Experiment with pre_format_hook in dump. Refs #103 2021-03-07 22:07:34 +01:00
Witold Filipczyk
ccc7ca3653 [python] http/1.1 spec says that default codepage is ISO-8859-1. 2021-01-16 21:05:02 +01:00
Witold Filipczyk
0fea79cc8f [cflags] Removed -Wno-pointer-sign
Likely some new bugs were introduced by this change.
The long term goal is clean compilation by g++.
2021-01-02 16:20:27 +01:00
Witold Filipczyk
085a93d544 [spidermonkey] JS_PS_END 2020-11-21 17:54:47 +01:00
Witold Filipczyk
477e56eb43 [smjs] Maybe it is not correct, but spidermonkey and smjs work together. 2020-11-17 18:46:27 +01:00
Witold Filipczyk
d1ecd45828 [mozjs52] It compiles, but often segfaults. No idea yet how to fix it. 2020-10-27 14:53:24 +01:00
Witold Filipczyk
a5b68a25a1 [mozjs45] Code is unstable, but at least compiles. 2020-10-23 22:34:58 +02:00
Witold Filipczyk
01c511f52d [mozjs38] ELinks is compilable, was not heavily tested. 2020-10-16 19:54:02 +02:00
Witold Filipczyk
ca24054cc6 [mozjs31] scripting smjs
It was not heavily tested.
2020-10-12 18:55:48 +02:00
Witold Filipczyk
1f57e72212 [mozjs24] Allow build elinks with g++
SpiderMonkey was updated to mozjs24. If you want to build elinks
with ecmascript support, you must compile using g++ with -fpermissive .
There is a lot of warnings.
There are some memleaks in ecmascript code, especially related to JSAutoCompartment.
I don't know yet, where and how to free it.

Debian does not support mozjs24, so I'm going to gradually update SpiderMonkey version.
2020-10-05 20:14:55 +02:00
Witold Filipczyk
5f87bdbcb2 [meson] meson build scripts.
Not finished yet, but I added to motivate myself and others.
The goal is to get a few seconds faster builds.

autotools still will be available.
2020-09-05 22:06:01 +02:00
Witold Filipczyk
f2557c9885 [python] Compilation warning 2020-08-09 19:50:19 +02:00
Witold Filipczyk
8b8f57ed75 [python] If page encoding is not "utf-8", encode it twice in pre_format_html_hook.
Once to utf-8 before pre_format_html_hook, and second time to the original encoding after python
script execution. I know it is inefficient, but computers are quite fast nowadays.
2020-08-09 17:45:22 +02:00
Felix Janda
f88e7c6081 Fix compilation with gcc-10
Fixes the errors

x86_64-pc-linux-gnu-ld: hooks.o:(.bss+0x0): multiple definition of `erb_module'; core.o:(.bss+0x0): first defined here
x86_64-pc-linux-gnu-ld: ruby.o:(.bss+0x0): multiple definition of `erb_module'; core.o:(.bss+0x0): first defined here

Bug: https://bugs.gentoo.org/730658
2020-08-02 17:42:47 -04:00
Witold Filipczyk
9e71d7f3c8 [scripting] lua_rawlen. Refs #46 2020-05-22 20:46:35 +02:00
Witold Filipczyk
b3e01b3298 [scripting] python scripting with Python3.
Only utf-8 encoding is supported.
2019-11-11 13:33:37 +01:00
Witold Filipczyk
3d96b0d7d7 Revert "Compile with C++."
This reverts commit 4f4df33638.
2019-04-21 12:27:40 +02:00
Witold Filipczyk
8d7112c27d Revert "Fix some issues with js."
This reverts commit 6322d2936a.
2019-04-21 12:26:27 +02:00
Witold Filipczyk
6322d2936a Fix some issues with js. 2019-02-17 23:33:12 +01:00
Witold Filipczyk
4f4df33638 Compile with C++.
Weak points:
- alignof
- js problems

Todo:
- make js work with C++ and mozjs-17
- then mozjs-24
- then mozjs-52
- then mozjs-60
- decrease number of warnings
2019-02-17 20:46:16 +01:00
Witold Filipczyk
25dd2ecae9 Changed ecmascript engine to mozjs-17.0.
Was not tested, especially smjs is likely buggy.
2019-02-10 21:00:37 +01:00
Witold Filipczyk
00d34fd0ed ruby: missing change PTR to LEN 2018-03-10 10:27:46 +01:00
Felix Janda
7a403ef735 Fix compatibility with Ruby >= 1.9
Based on patch by Ian Abbott

Bug: https://bugs.gentoo.org/424789
2018-03-09 17:34:30 -05:00
Witold Filipczyk
0dd3aaabe6 int -> size_t 2018-02-25 17:14:46 +01:00
Felix Janda
254f440de4 Remove references to internal-hooks.scm 2018-02-24 15:08:17 -05:00
Felix Janda
cec24f11a4 guile: update deprecated string functions 2018-02-24 15:05:45 -05:00
Felix Janda
a0a063f784 guile: replace discouraged SCM_FALSEP, SCM_NULLP, SCM_STRINGP 2018-02-24 14:18:25 -05:00
Marco Migliori
f1fb95835a display lua hooks errors 2017-05-16 20:54:56 +02:00
Witold Filipczyk
52d6f37c8e Explicit cast to (const char *) for strchr function (C++) 2016-04-20 19:43:37 +02:00
Witold Filipczyk
c84dfd7e18 mem_free_if where aplicable. Initialised memory in encoding/* 2015-05-10 17:27:55 +02:00
M. Levinson
a229adb19a A more nuanced approach to Python warnings.
By default some Python warning messages would be written to standard error
by the interpreter. To prevent these warnings from making a mess of the
ELinks screen, all warnings were turned into exceptions so they could be
caught and displayed through the usual report_scripting_error() mechanism.

With Python 3.2, this approach backfires: A new class of ResourceWarnings
that are filtered by default (and hence would *not* have been written to
standard error) are now turned into exceptions, and these exceptions can't
be caught because they're emitted from the interpreter's cleanup code. As
a result, the uncaught exceptions would make a mess of the ELinks screen.

The new solution is to replace Python's standard library function
warnings.showwarning() with one that turns warning messages into exceptions.
This means we'll wait until a warning would have been written to standard
error before turning it into an exception, so other warnings that would
never have reached that point because they're filtered will remain unseen.

(The behavior of warning messages is described in the documentation for
the "warnings" module from Python's standard library.)
2013-07-05 12:29:58 +02:00
Kalle Olavi Niemitalo
c4a23543fd SMJS: verbose comment about JS_AddNamedStringRoot 2012-11-25 21:06:09 +02:00
Kalle Olavi Niemitalo
d3022aa7be SMJS bookmark_set_property: Don't use JS_ValueToId.
Partially revert commits
a1c5fe51 (2011-05-08) bookmark_folder_get_property: xulrunner-2.0 fix
e86ec567 (2012-03-04) Compilation fixes (--enable-debug)

jsval_to_bookmark_string once again takes jsval val, rather than jsid id.
This way, bookmark_set_property does not have to call JS_ValueToId,
which would needlessly intern the new string value of the property,
i.e. the title or the URI.  Instead, bookmark_folder_get_property
has to call JS_IdToValue.
2012-11-19 02:53:14 +02:00
Kalle Olavi Niemitalo
380d910ad8 SMJS: Use JS_THIS_OBJECT and JS_CALLEE, not argv[-1] and argv[-2]
https://developer.mozilla.org/en-US/docs/SpiderMonkey/1.8.5 mentions
that JSNative functions must not use negative indices of argv in
SpiderMonkey 1.8.5.  Use the JS_THIS_OBJECT and JS_CALLEE macros
instead.  They are documented in
https://developer.mozilla.org/en-US/docs/SpiderMonkey/JSAPI_Reference/JSNative
2012-11-19 00:39:51 +02:00
Kalle Olavi Niemitalo
9e11e30fe3 bug 764, LUA: option_types[OPT_INT].set needs long *
l_set_option() was passing the address of an int to
option_types[OPT_INT].set and option_types[OPT_BOOL].set.
That looks correct but is not: both function pointers
point to num_set(), which actually reads *(long *) str.
Change l_set_option() to pass the address of a long instead,
and add comments about this dependency.
(cherry picked from elinks-0.11 commit 8766e3829f)
(cherry picked from elinks-0.12 commit 0797f04921)
2012-11-03 23:01:28 +02:00
Kalle Olavi Niemitalo
6f4c95cc7f Bug 943: Refuse user JS actions in unfocused tabs
(cherry picked from elinks-0.12 commit 51dc3beee7)

Conflicts:
	NEWS: Both 0.12pre5.GIT and 0.13.GIT had inserted a new section.
	src/terminal/window.c: Both had inserted a new function.
2012-11-03 22:10:27 +02:00
witekfl
e86ec567f2 Compilation fixes (--enable-debug) 2012-03-04 18:11:18 +01:00
Miciah Dashiel Butler Masters
c74ddb29c5 SMJS: add terminal object
Add terminal_class, which defines a JSObject wrapper for struct terminal.

Add terminal_array_class, which defines a JSObject wrapper for accessing
the "terminals" linked list of struct terminal.

Add session_array_class, which defines a JSObject wrapper for accessing the
tabs (sessions) of a terminal.

Add pointers from struct terminal to the terminal_class object and
the session_array_class object.

Add terminal_props and terminal_get_property for terminal_class.

Add terminal_finalize, which clears the pointers between a struct terminal
and the JSObject wrapper in question.

Add smjs_init_terminal_interface, which creates a terminal_array_class
instance and assigns it to  the "terminal" property on the "elinks" object.
Call smjs_init_terminal_interface from smjs_init_elinks_object.

Add smjs_get_terminal_object and smjs_get_session_array_object to get
the wrapper objects for a given struct terminal, and add
smjs_get_terminal_array_object to get a terminal_array_class object.

Add smjs_detach_terminal_object and smjs_detach_session_array_object, which
clear the pointers between a given struct terminal and its JSObject
wrappers.

Add terminal_array_get_property for terminal_array_class.

Add session_array_get_property for session_array_class.
2011-11-14 04:34:51 +00:00
Miciah Dashiel Butler Masters
cdad9adf19 SMJS: add session object
Add session_class, which defines a JSObject wrapper for struct session.

Add location_array_class, which defines a JSObject wrapper for struct
ses_history.  The "history" member of struct session is a struct
ses_history, which is a linked list of struct location.

Add a pointer from struct session to the session_class object and the
location_array object.

Add smjs_get_session_object to return a session_class JSObject wrapper for
a given struct session.

Add smjs_get_session_location_array_object to return a location_array_class
JSObject wrapper for a given struct session.

Add "session" property to the "elinks" object, which uses
smjs_get_session_object to get a JSObject wrapper for smjs_ses.

Add smjs_location_array_get_property, which allows indexing
a location_array object using a positive number for history forward or
a negative number for history backward.

Add session_props, session_get_property, session_set_property,
session_funcs, smjs_session_goto_url (which implements the "goto" method),
and smjs_init_session_interface for session_class.

Add session_construct, which creates a new tab and returns the JSObject
session_class wrapper.

Add session_finalize and smjs_location_array_finalize, which clear the
pointers between struct session and the JSObject wrappers in question.

Add smjs_detach_session_object, which clears the pointers between a given
struct session and the corresponding JSObject wrappers.

In destroy_session, call smjs_detach_session_object.

Add jsval_to_object helper in ecmascript/spidermonkey/util.h;
jsval_to_object is used in smjs_session_goto_url.

Modify delayed_goto_uri_frame to allow the target to be NULL.
smjs_session_goto_url needs this modification.
2011-11-14 04:34:51 +00:00
Miciah Dashiel Butler Masters
3932af9b17 SMJS: handle view_state outliving wrapping object
Currently, it is possible for the JSObject that wraps a struct view_state
to outlive the view_state.  Using the properties of the JSObject wrapper
will then cause a crash.

This patch adds a smjs_detach_view_state_object function, which is called
in destroy_vs, to dissociate the struct view_state from the JSObject
wrapper.  To this end, the patch modifies the struct view_state to point
the JSObject wrapper.  smjs_get_view_state_object will use this pointer
if it is set, and copy_vs will copy this pointer to the new view_state.
The patch also modifies view_state_get_property and
view_state_set_property to return immediately if the view_state has been
destroyed.  Finally, the patch adds a finalizer (view_state_finalize)
that clears the pointer from the struct view_state to the JSObject.
2011-11-14 04:34:51 +00:00
Miciah Dashiel Butler Masters
211c624aca smjs_get_elinks_object: drop jsobj temp variable
After recent simplifications, the jsobj variable is no longer necessary.
Instead of assigning it a value and then returning it, just return the
value that was being assigned to it.
2011-11-14 04:34:51 +00:00
Miciah Dashiel Butler Masters
54c33284fc elinks_get_property: return empty string if no URI
For the elinks.location property, if elinks_get_property fails to find
a URI, just return the empty string rather than returning an error.
2011-11-14 04:34:51 +00:00
Miciah Dashiel Butler Masters
e092b6b08b SMJS: refactor elinks object's property handlers
Add elinks_get_property and elinks_set_property functions and
a JSPropertySpec elinks_props table to handle properties rather than
defining eilnks_get_home, elinks_get_location, and elinks_set_location
and adding them individually to the class using JS_DefineProperty.
This approach will make it easier to add further properties.
2011-11-14 04:34:51 +00:00
Miciah Dashiel Butler Masters
68801b7382 elinks_object: use usrerror if there is no term
Currently, elinks_alert assumes that smjs_ses is not NULL and crashes if
it is.  Change elinks_alert to check whether smjs_term is NULL, try
get_default_terminal if so, and fall back on printing to stderr using
usrerror if no terminal is found.
2011-11-14 04:34:51 +00:00
Miciah Dashiel Butler Masters
e310843a2a smjs_load_uri: check for empty URI
In smjs_load_uri, check whether the the given URI string is empty.  If it
is, return JS_FALSE right away rather than continuing on and passing
get_uri an empty string, which triggers an assertion failure later on.
2011-11-14 04:34:51 +00:00
Miciah Dashiel Butler Masters
a3918d8c30 cache_entry_get_property: fix assertion failure
In cache_entry_get_property, don't assert the return value from
get_cache_fragment; instead, just return JS_FALSE if the value is NULL.
2011-11-14 04:34:50 +00:00
Miciah Dashiel Butler Masters
da209c6b6f smjs_load_uri: return if there is an external handler
Currently, using smjs_load_uri on javascript: URIs cause an assertion
failure in run_connection because smjs_load_uri uses
get_protocol_handler to find the handler and asserts that the returned
handler is not NULL, but get_protocol_handler returns NULL for
javascript: URIs.

In smjs_load_uri, if the given URI has a protocol for which some
external handler is defined, immediately return JS_FALSE because
smjs_load_uri implements an asynchronous operation, and we cannot
reasonably carry out the operation and callback with an external
handler.
2011-11-14 04:34:50 +00:00
Miciah Dashiel Butler Masters
bdeace4811 keymap_set_property: xulrunner-2.0 fix
In keymap_set_property, convert the jsid value into a jsval value before
calling JS_ValueToString on it.
2011-11-14 04:34:50 +00:00
Miciah Dashiel Butler Masters
a1c5fe518b bookmark_folder_get_property: xulrunner-2.0 fix
In bookmark_folder_get_property, convert the jsid value into
a jsval value before passing it to jsval_to_bookmark_string.

This commit fixes a bug in the xulrunner-2.0 compatibility changes
of commit 2844f8b715, which rendered
the bookmarks scripting interface for SpiderMonkey nonfunctional.
2011-05-08 03:04:10 +00:00
witekfl
2844f8b715 JS_VERSION at least 185 is required for ECMASCript (xulrunner-2.0 or later)
The code wasn't tested. It compiles
2011-04-19 22:41:05 +02:00
Miciah Dashiel Butler Masters
d6bd7987d4 Introduce set_kbd_repeat_count
Introduce and use ses_kbd_repeat_count to change
ses->kbdprefix.repeat_count instead of setting it directly.

This change should not cause any change in behaviour.
2010-09-16 01:33:45 +00:00
Witold Filipczyk
98a7ca3635 Silent lua warnings. 2010-07-26 09:30:11 +02:00
Witold Filipczyk
331a4dc62b Link against lua51, not lua50. 2010-07-21 19:07:49 +02:00
Kalle Olavi Niemitalo
ef548e5728 Merge branch 'elinks-0.12'
Conflicts:
	src/session/download.c
	src/session/download.h
	src/viewer/text/view.c
2009-07-24 18:32:25 +03:00
Kalle Olavi Niemitalo
b427a4f159 Small Doxygen fixes 2009-07-17 23:58:38 +03:00
Kalle Olavi Niemitalo
7bb51e7139 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:
	NEWS
	configure.in
	doc/man/man1/elinks.1.in (regenerated)
	doc/man/man5/elinks.conf.5 (regenerated)
	doc/man/man5/elinkskeys.5 (regenerated)
	po/af.po (kept 0.13.GIT)
	po/be.po (kept 0.13.GIT)
	po/bg.po (kept 0.13.GIT)
	po/ca.po (kept 0.13.GIT)
	po/cs.po (kept 0.13.GIT)
	po/da.po (kept 0.13.GIT)
	po/de.po (kept 0.13.GIT)
	po/el.po (kept 0.13.GIT)
	po/es.po (kept 0.13.GIT)
	po/et.po (kept 0.13.GIT)
	po/fi.po (kept 0.13.GIT)
	po/fr.po (kept 0.13.GIT)
	po/gl.po (kept 0.13.GIT)
	po/hr.po (kept 0.13.GIT)
	po/hu.po (kept 0.13.GIT)
	po/id.po (kept 0.13.GIT)
	po/is.po (kept 0.13.GIT)
	po/it.po (kept 0.13.GIT)
	po/lt.po (kept 0.13.GIT)
	po/nb.po (kept 0.13.GIT)
	po/nl.po (kept 0.13.GIT)
	po/pl.po (kept 0.13.GIT)
	po/pt.po (kept 0.13.GIT)
	po/pt_BR.po (kept 0.13.GIT)
	po/ro.po (kept 0.13.GIT)
	po/ru.po (kept 0.13.GIT)
	po/sk.po (kept 0.13.GIT)
	po/sr.po (kept 0.13.GIT)
	po/sv.po (kept 0.13.GIT)
	po/tr.po (kept 0.13.GIT)
	po/uk.po (kept 0.13.GIT)
	src/ecmascript/ecmascript.c
2009-07-11 16:47:33 +03:00
Kalle Olavi Niemitalo
10c07f9933 Debian bug 534835: Check some SpiderMonkey return values
Perhaps because of bug 981, if one opened hundreds of pages with
elinks --remote openURL(...), then ELinks 0.11.4 could crash with a
SIGSEGV in JS_InitClass called from spidermonkey_get_interpreter.
SpiderMonkey ran out of memory and began returning NULL and JS_FALSE
but ELinks didn't notice them and pressed on.  Add some checks to
avoid the crash, although the underlying out-of-memory error remains.
2009-06-27 19:48:56 +03:00
Miciah Dashiel Butler Masters
6a8e0ccd9b Lua: Report bad arguments to edit_bookmark_dialoga
If edit_bookamrk_dialogs is given the wrong number or types of
arguments, report the problem to the user instead of failing silently.
2009-04-05 12:57:35 +00:00
Kalle Olavi Niemitalo
3581e2848e Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:
	doc/installation.txt
	src/protocol/http/http.c
2009-02-28 18:22:54 +02:00
Kalle Olavi Niemitalo
1487d206db Bug 1069: Revert "1031: JS_SetErrorReporter only once per JSRuntime."
This reverts commit b94657869b.
I don't know where I got the idea that JS_SetErrorReporter affects the
entire JSRuntime, rather than only the provided JSContext.  The people
on #jsapi say it has never worked that way.
2009-02-26 22:56:33 +02:00
Miciah Dashiel Butler Masters
e9370fe5b9 Comment the last change 2009-02-25 01:54:36 +00:00
Miciah Dashiel Butler Masters
44dc9a1f46 Comment the last change 2009-02-25 01:54:16 +00:00
Miciah Dashiel Butler Masters
f11b2a8f97 utf8_to_jsstring: Don't free mem handed over to JS
In utf8_to_jsstring, do not free the string that is passed to
JS_NewUCString if the latter is successful; if it is, SpiderMonkey
handles the memory from then on.

Use libc routines instead of ELinks's routines to allocate and free the
string so that ELinks's memory debugging code does not try to keep track
of it after it has been handed to SpiderMonkey.

This commit fixes a bug introdued in
97d72d15a0.
2009-02-25 01:45:56 +00:00
Miciah Dashiel Butler Masters
50ff8fd835 utf8_to_jsstring: Don't free mem handed over to JS
In utf8_to_jsstring, do not free the string that is passed to
JS_NewUCString if the latter is successful; if it is, SpiderMonkey
handles the memory from then on.

Use libc routines instead of ELinks's routines to allocate and free the
string so that ELinks's memory debugging code does not try to keep track
of it after it has been handed to SpiderMonkey.

This commit fixes a bug introdued in
97d72d15a0.
2009-02-25 01:37:13 +00:00
Witold Filipczyk
9054e57c55 Merge branch 'elinks-0.12'
Conflicts:
	src/document/dom/renderer.c
2009-02-12 10:01:57 +01:00
Kalle Olavi Niemitalo
7067fc7af9 Check for JS_ReportAllocationOverflow before using it.
Debian libmozjs-dev 1.9.0.4-2 has JS_ReportAllocationOverflow but
js-1.7.0 reportedly hasn't.  Check at configure time whether that
function is available.  If not, use JS_ReportOutOfMemory instead.

Reported by Witold Filipczyk.
2009-02-08 23:07:22 +02:00