| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Operation "modularize Chawan somewhat" part 3
|
| |
|
|
|
|
| |
It would silently truncate the upper 32 bits... not a very bright idea.
|
|
|
|
|
|
|
| |
* prefix to-be-separated modules with js
* remove dynstreams dependency
* untangle from EmptyPromise
* move typeptr into tojs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we didn't actually free the main JS runtime, probably because
you can't do this without first waiting for JS to unwind the stack.
(This has the unfortunate effect that code now *can* run after quit().
TODO: find a fix for this.)
This isn't a huge problem per se, we only have one of these and the OS
can clean it up. However, it also disabled the JS_FreeRuntime leak
check, which resulted in sieve-like behavior (manual refcounting is
a pain).
So now we choose the other tradeoff: quit no longer runs exitnow, but
it waits for the event loop to run to the end and only then exits the
browser. Then, before exit we free the JS context & runtime, and also
all JS values allocated by config.
Fixes:
* fix `ad' flag not being set for just one siteconf/omnirule
* fix various leaks (since leak check is enabled now)
* use ptr UncheckedArray[JSValue] for QJS bindings that take an array
* allow JSAtom in jsgetprop etc., also disallow int types other than
uint32
* do not set a destructor for globals
|
|
|
|
|
| |
Unsigned operations and conversions to unsigned types always wrap/narrow
without checks, so no need to manually mask/cast/etc. them.
|
|
|
|
|
|
| |
* separate params with ; (semicolon) instead of , (colon)
* reduce screaming snake case use
* wrap long lines
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's a bad idea for several reasons:
* it's inefficient; must allocate an environment for a closure in Nim,
even though we already have one in JS
* writing macros for automatically creating functions with variadic
arguments is suprisingly difficult (see the entire `js/javascript'
module)
* it never really worked properly, because we never freed the associated
function pointer.
We hardly used it anyway, so the easiest fix is to get rid of it
completely.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
until now, this had very strange (and inconsistent) semantics:
* err() was used for exception propagation, but also as a null value
* Option accepted undefined as a none value, but not null
* Opt and Option were used interchangeably (and mostly randomly)
Now, Result is always used for error reporting, and err(nil) means
JS_EXCEPTION. (Opt is a special case of Result where we don't care about
the error type, and is not used in JS.)
Option on the other hand means "nullable variation of normally
non-nullable type", and translates to JS_NULL. In JS we mainly use
it for turning strings nullable.
|
|
|
|
|
|
|
|
|
| |
* Parse the default config at runtime. There's no significant
performance difference, but this makes it much less painful to write
config code.
* Add better error reporting
* Make fromJS2 easier to use
* Unquote ChaPaths while parsing config
|
|
|
|
|
|
| |
* the uint8array thing is probably from txiki.js, but we never used it
* upstream now has JS_GetClassID, importing that instead... (so this
commit won't build :/)
|
|
|
|
|
|
|
| |
I've gotten tired of not being able to search for forward slashes.
Now it works like in vim, and you can also set default ignore case in
the config.
|
|
|
|
| |
std enum parsing uses Nim ident matching rules, which is incorrect here.
|
|
|
|
|
| |
* turn JSFuncGenerator into a ref object (it's faster this way)
* remove strformat dependency
|
|
|
|
| |
They only had type definitions, no need to put them in separate modules.
|
| |
|
|
|
|
| |
much better
|
|
|
|
|
|
|
|
|
|
| |
* Add select & copy selection functionality to container
* Fix bug in generateSwapOutput where output could be misplaced
because of zero-width cells
* Add fromJSPromise, call runJSJobs in every iteration of the
headed event loop
* "await" pager actions that output a promise
* Change default view source keybinding to `\'
|
|
|
|
| |
Use option() instead of some()
|
|
|
|
| |
Special case the global object, check for inheritance, etc.
|
| |
|
| |
|
|
|
|
| |
to match standard behavior (e.g. accept null as int, etc)
|
|
|
|
|
| |
We now expose some functions from QuickJS to interact with JavaScript
strings without re-encoding them into UTF-8.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* ips -> io/
* loader related stuff -> loader/
* tempfile -> extern/
* buffer, forkserver -> server/
* lineedit, window -> display/
* cell -> types/
* opt -> types/
|
|
|
|
| |
And use that in extern().
|
|
|
|
|
|
|
| |
Mostly a proof of concept. Just bubble it unconditionally for now
and never prevent default.
Also, fix fromJSFunction by Dup'ing its closure JSValue.
|
|
|
|
|
|
| |
* fromJSFunction: dup the value, so that it cannot go out of context.
* setOpaque no longer calls GC_ref, so no need for it to be generic
instead of just taking a pointer.
|
|
|