| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
The runtime cast is defined anyway by the GObject macros, and allows
turning runtime checking on or off at build time as desired.
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
Avoid using char type in uniform_int_distribution<T> template
Closes #514
See merge request GNOME/gjs!807
|
| |
| |
| |
| |
| |
| |
| | |
This is undefined behaviour. GCC and pre-15.x Clang accept it, so we
didn't notice it before.
Closes: #514
|
| |
| |
| |
| |
| |
| | |
These will contain g-i 1.73.0 which contains a memory leak fix that we
will need to run the new tests on this branch successfully with
sanitizers enabled.
|
|/
|
|
| |
Changes the Dockerfiles to build mozjs102 by default, as well.
|
|
|
|
|
| |
This reverts commit 825d85a1057d2330c2811116315669606b8e4ac3. It's no
longer needed after fixing the setjmp warnings.
|
|
|
|
|
| |
This comment didn't make sense where it was placed, put it next to the
code that it refers to.
|
|
|
|
|
| |
Since more functions will move out of jsapi.h in the future, it'll be
useful to know why exactly we are including it.
|
|
|
|
|
|
| |
This function was necessary in SpiderMonkey 91, but now the same
functionality is part of the SpiderMonkey API. There is no longer any need
to define our own.
|
|
|
|
| |
In particular, in finalize operations.
|
|
|
|
|
| |
This has some cascade effects on the signatures of other methods, since
we now need to pass the JSTracer in.
|
|
|
|
|
|
|
|
|
|
|
| |
- js/CallAndConstruct.h: Now contains JS::Call, JS::Construct, and
related
- js/Debug.h: Already existed, but now contains JS_DefineDebuggerObject
- js/GlobalObject.h: Now contains JS::CurrentGlobalOrNull
- js/PropertyAndElement.h: Now contains APIs for getting, setting, and
defining properties, as well as array elements
- js/ScriptPrivate.h: Now contains JS::GetScriptPrivate/SetScriptPrivate
- js/Stack.h: Now contains APIs that have to do with the call stack
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
JS::GetPrivate() and JS::SetPrivate() are going away in SpiderMonkey
102. The replacement is to stuff the pointer into a JS::PrivateValue and
store it in an object's reserved slot. This is a change we can make prior
to the switch.
With SpiderMonkey 102, we are intended to use
JS::GetMaybePtrFromReservedSlot() to retrieve the pointer. This function
doesn't exist in SpiderMonkey 91, but it is a small inline function that
we can open-code in jsapi-util.h.
In most of the cases, we can encapsulate this access into three methods
of CWrapperPointerOps: has_private(), init_private(), and unset_private().
(Retrieving the pointer was already encapsulated by the various for_js()
methods.) This provides better safety anyway, because in init_private()
we can enforce that there was no pointer already set. We define that
reserved slot 0 is always the private pointer.
BoxedInstance already used slot 0 for something else, so that moves to
slot 1.
Based on Evan's commit from the mozjs102 branch.
Co-authored-by: Evan Welsh <contact@evanwelsh.com>
|
|
|
|
|
|
| |
As with every release, IWYU's algorithms have slightly changed, and some
bugs have been fixed meaning we can remove some workarounds from the
postprocessing script; unfortunately other bugs have appeared as well.
|
|
|
|
|
|
|
|
|
| |
There are some warnings showing up with the new version of the compiler
in the newly-built image that don't have obvious fixes. Normally we stop
the build if there are warnings, but we will temporarily disable that and
allow it to proceed until these new warnings can be fixed. (One of them
seems to come from SpiderMonkey and would be fixed in the SpiderMonkey
upgrade, it seems.)
|
|
|
|
|
| |
We need to bail out if the upstream base _commit_ is already found, not
the upstream base _branch_.
|
|
|
|
|
|
| |
This package is needed in order to support all the encodings that the
WHATWG Encoding standard requires. It looks like it was split out from
another package in Fedora 36, so it needs to be added explicitly.
|
|
|
|
|
|
| |
This is tracked upstream in:
https://trac.cppcheck.net/ticket/10731
For the time being, work around it.
|
|
|
|
|
|
|
|
|
|
| |
mozjs91 cannot be built with Python 3.10 due to a bug, so we have to
install Python 3.9 separately and use it.
glibc-debuginfo-common no longer exists in Fedora 36.
Requires a bump of the freedesktop CI template as well, due to broken
seccomp on the older buildah image.
|
|
|
|
|
| |
It could have been built by another pipeline apparently as we may get an
error that the branch already exists.
|
| |
|
|
|
|
|
| |
This is the actual recipe that has been used to generate the current
image, but I forgot to update the branch that got merged earlier.
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
Verbose object print output
Closes #107
See merge request GNOME/gjs!587
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It makes sense for the prettyPrint() function to be written in JS, but it
does need to be called internally in Console.interact() which is written
in C++. Therefore, create a slot on the global object in which to store
the prettyPrint() function, which can be retrieved when needing to call
the function from internal code.
Console.interact() no longer needs to use gjs_value_debug_string(), so
that code and its dependencies can be removed.
Also pass the arguments of log() and logError() through prettyPrint().
This enables the work from #107.
|
|/
|
|
|
| |
Per https://github.com/cpplint/cpplint/issues/190 cpplint is not intended
for that.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, when calling gjs_throw() with an exception already pending,
the new exception would be dropped, after logging it in the debug output
in case it contained extra information.
Now that we have Error.cause, we can append the new exception to the cause
chain of the currently pending exception. This potentially gives more
relevant information immediately to the programmer without having to dig
in the debug log.
In the case where the end of the cause chain is not an object, or there is
a reference cycle in the cause chain, we fall back to the same debug
logging that we did before.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BigInt values are now accepted as parameters to C functions that take
64-bit integers.
For now BigInts are only accepted for 64-bit parameters. We may allow
BigInt for any parameter in the future (once we've checked that we don't
go out-of-range), for now we assume that BigInt values are used only for
functions taking a type that can mostly handle them.
For bounds checks, given that we don't have a bigger value holder than
(u)int64_t, we have to create a new wrapper to avoid taking the fast path
in gjs_arg_set_from_js_value(), and without having to hack
type_has_js_getter().
As per this, now for 64bit integers we use TypeWrapper as the type holder
that has conversion operators to the base type, and for which we can then
add a js_value_to_c_checked() specialization.
See: #271
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using JS::ToBigInt64 to debug BigInt means that we can only access the
first 64-bit digit of the BigInt. (We can convert the whole thing to a
string, but that might allocate and fail, which we don't want in a debug
function.) Note this in debug messages, because I got myself confused a
few times while working on this branch.
Also use the new JS::BigIntIsNegative() API in mozjs91 to improve the
output, casting the first digit into a signed int if the BigInt was
negative, and an unsigned int if it was positive.
|
|
|
|
|
|
| |
This is done intentionally in this test to ensure that we don't crash, but
the warning itself makes sense because you are generally not supposed to
do this.
|
|
|
|
|
| |
Fixes a few cases where a null out parameter is written to, which would
cause a crash. Adds tests for these cases.
|
|
|
|
|
|
|
| |
There used to be a bug in SpiderMonkey where a GC would sometimes erase
realm code coverage data. This bug no longer exists, so remove the
workarounds that would skip tests when run under code coverage.
(The bug was https://bugzilla.mozilla.org/show_bug.cgi?id=1447906)
|
|
|
|
|
| |
No longer necessary to build mozjs78 images. MOZJS_BUILDDEPS must still be
set to mozjs78 until the underlying OS gains a mozjs91 package.
|
|
|
|
|
|
|
|
| |
- JS_[Get,Set]Private is now JS::[Get,Set]Private
- JS_GetReservedSlot is now JS::GetReservedSlot
- JS_SetReservedSlot still exists, but we'll update it now
See https://bugzilla.mozilla.org/show_bug.cgi?id=1663365
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added
- js/experimental/TypedData.h
- js/friend/DumpFunctions.h
- js/Context.h
- js/MapAndSet.h
- js/String.h
Updated
- js/ErrorReport.h
- js/Exception.h
- js/GCAPI.h
- js/Realm.h
Removed
- js/RequiredDefines.h
See https://bugzilla.mozilla.org/show_bug.cgi?id=1708330
See https://bugzilla.mozilla.org/show_bug.cgi?id=1656411
See https://bugzilla.mozilla.org/show_bug.cgi?id=1663365
|
| |
|
|
|
|
|
|
|
|
|
| |
In GjsAutoPointer, T* is the type of the pointer, but F* is the type of
the pointer that ref_func/free_func accept. We need to cast to F* when
calling these functions.
Previously this mostly worked because F = void, but it would not compile
if F != void and F != T.
|
|
|
|
|
| |
There is already a predefined GitLab CI environment variable for the job
name, $CI_JOB_NAME, so we don't need to define one.
|
|
|
|
|
|
|
|
| |
Also remove the 'thread-safe' test suite, since the job is now marked as
allowed-to-fail, we may as well run TSAN on the tests where we know that
GLib or GIO cause false positives.
See #440 for steps to restore the job.
|
|
|
|
| |
This is an upgrade to continue building against more recent versions.
|
|
|
|
|
|
| |
We're currently keeping a list of trampolines in a static vector, this
is acceptable (at least for a single-context scenario), but trampolines are
bound to a specific context so better to move the handling in the context.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GjsMaybeOwned had a notification support that was used only by Closures
(other than tests), this was causing adding an extra pointer to all
the types using it (including Object) that was mostly unused.
So, move this into private context, re-implementing it using our own
notifier (instead of relying on GObject's that needs a specific order) and
use it in closures.
Also add an hook to handle gc events on private context that will be in
later changes to cleanup more things, but for now is used to shrink the
closures vector once we've done.
|
|
|
|
|
|
|
|
| |
The 'S' specifier also expects a string argument, or additionally null if
it is given as '?S'. Unlike 's' and 'F', it does not convert the string
value at all, and instead puts it into a JS::MutableHandleString.
This will be used in the Encoding specification.
|
|
|
|
|
|
|
|
|
|
| |
Apparently I never checked what happened when this assertion failed. Since
it is only used directly in run_code_expect_exception(), the string and
pattern are generated dynamically, so the error message would be something
like '("message" matches "pattern")', totally unhelpful.
Use g_assertion_message_cmpstr() with a made-up comparison operator, to
give a more helpful message.
|
|
|
|
|
|
|
|
|
| |
Fedora removed this from their build dependencies of mozjs78, but they had
to add a big patch which we don't want to carry in ptomato/mozjs. So add
autoconf213 to the list of dependencies to install manually.
See commit:
https://src.fedoraproject.org/rpms/mozjs78/c/0be21c3fd170b1e5e5920c4a59d6c7d6c6b9c7f7?branch=f33
|
|
|
|
|
| |
We print out the value % INT64_MAX in this debug function because printing
out the full value requires a JSContext and may be fallible.
|
| |
|