| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
This was previously done with a slightly circuitous call to
Object.assign(); it can be done more readably with spread syntax.
|
|
|
|
|
|
|
|
|
|
|
| |
We get this for free already for Symbol primitive values and Symbol
property keys and values, due to it being supported in the
pretty-printer. For the 'keys' command, we need to start using
Object.getOwnPropertySymbols() to get the Symbol property keys.
While we are at it, switch from using Object.keys() which only gives
enumerable string/number property keys, to Object.getOwnPropertyNames(),
in order to be able to debug non-enumerable properties as well.
|
|
|
|
|
| |
Introduce a new property key formatter which formats a Symbol property
key in brackets.
|
|
|
|
|
|
|
| |
This formats Symbols as the source text with which they should be able
to be constructed. It makes a distinction between registered symbols
(created with Symbol.for()), well-known symbols (always existing), and
regular symbols (created with Symbol()).
|
|
|
|
|
|
| |
In the pretty-printer, if an object or a function has has its toString()
method overridden, the overridden toString() is preferred. Refactor this
check slightly so that we can put more cases in the switch statement.
|
| |
|
| |
|
| |
|
|
|
|
| |
An expression like {a:2} is ambiguous since it can be an object literal with property a and value 2 or a statement block with label a and one expression inside, 2. Adding () disambiguates {}.
|
| |
|
| |
|
|
|
|
| |
Closes: #107
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
dv.class is no longer Error for subclasses of Error,
without this change the debugger will print {} instead
of [object TypeError]
|
|
|
|
|
|
|
| |
Previously, pressing Ctrl+D at the debugger prompt would log an internal
error because repl() would return undefined at EOF. It looks like the code
here was actually expecting null for EOF, but we also need to explicitly
quit the debugger in the EOF case and not just return.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Right now execution stops whenever an exception is thrown,
regardless of whether the exception was handled or not.
This gets annoying fast when exceptions are expected, for
example when handling EEXISTS after attempted file operations
instead of doing (racy) existence checks.
Address this by ignoring handled exceptions by default, with
the option to restore the old behavior.
https://gitlab.gnome.org/GNOME/gjs/-/issues/431
|
| |
|
|
|
|
|
| |
(Changes from Philip folded in: use native function with reserved slot to
store built argv array)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Debugger.Environment.getVariable() may return one of the three sentinel
values {missingArguments: true}, {optimizedOut: true}, or {uninitialized:
true} if a variable does not have a value for some reason. Handle these
special values in debuggeeValueToString().
"missingArguments" means that a function argument was optimized out,
"optimizedOut" means that a regular variable was optimized out, and
"uninitialized" means that a variable is present in the environment but
hasn't been initialized yet, for example when breaking on an exception
thrown while initializing it.
Also adds a test for the latter case (printing a backtrace with locals,
when breaking on an exception that leaves a local variable uninitialized.)
https://searchfox.org/mozilla-central/rev/6a6a366031680829746b5d2362610b868fd9571a/js/src/debugger/Debugger.cpp#1412-1435
|
| |
|
|
|
|
| |
Closes: GNOME/gjs#208
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The debugger already stores the result of each printed expression in
variables named $1, $2, etc., so you can refer to them later. This change
makes the variable '$$' always refer to the last printed value.
Adds a bit of documentation explaining how these variables can be printed,
and adds a test for $$ as well as $1, $2, etc.
Based on a commit from Mozilla's original jorendb:
https://hg.mozilla.org/mozilla-central/rev/fe52996292bb6d1acd51a983f9a7ac6faa7724f6
(The GJS debugger was originally based on jorendb and I was looking to see
if any new improvements had been made since I had forked it)
|
|
|
|
|
|
|
|
|
|
|
|
| |
Based on looking at the git logs, add copyright notices to files which
were missing them, assuming the copyright belongs to people who made major
contributions to each file.
Some assumptions were made as to who to assign the copyright to, such as,
what copyright assignment did the contributor make in other files added in
the same commit? What email address did they use to make the commit? What
copyright assignment did they make in other commits using the same email
address?
|
|
|
|
|
|
|
|
|
|
|
| |
ESLint has deprecated jsdoc and instead recommends eslint-plugin-jsdoc.
lint-condo does not have eslint-plugin-jsdoc. We only use lint-condo for
eslint currently and it is simpler to instead use yarn to install and
manage eslint.
Some module files had JSDoc comments which violated the jsdoc
plugin's more stringent rules.
|
|
|
|
|
|
| |
This adds a SPDX-License-Identifier comment to all files that are part
of GJS, part of its unit tests, or auxiliary tools. (Except for some
files like the debugger scripts that don't support comments.)
|
|
|
|
|
|
|
|
| |
The SPDX format is machine-readable, which should make it much easier to
avoid mistakes with licensing and copyright using automated tools.
This commit does not add any implicit information. It converts exactly
what was already specified into SPDX format comments.
|
|
|
|
|
|
|
|
| |
In order to match the GJS_MODULE_PROP_FLAGS that they were previously
defined with before the split into a separate module, the print
functions need to be defined with writable: true on the global object.
Without this, `spyOn(globalThis, 'print')` will not work.
|
|
|
|
|
|
|
|
| |
This was removed in https://bugzilla.mozilla.org/show_bug.cgi?id=1564168
and is no longer needed. Switching off the debugger is replaced by
Debugger.removeAllDebuggees(), other uses can just be dropped.
See: GNOME/gjs#329
|
| |
|
| |
|
|
|
|
|
| |
Starting with SpiderMonkey 68, the standards-compliant trimStart() and
trimEnd() replace the old trimLeft() and trimRight().
|
|
|
|
|
|
|
|
|
| |
As of mozjs68 (gjs-1.64) `globalThis` is recommended over `window` and
it makes more sense in this context anyways. Migrate the few instances
of `window` we use and adjust the eslint configuration.
`window` will continue to resolve to `globalThis`, so this won't affect
extensions or other downstream users.
|
|
- Rename and move modules.gresource.xml -> js.gresource.xml
This reflects that new environments may require JS
resources outside of modules/
- Move the "core" cairo, format, gettext, and signals logic
to modules/core/ to allow reuse across environments.
- Move the "legacy" (script-based) modules to modules/script/
- Move the script-based bootstrap files to modules/script/
- Move overrides to modules/core/ as they will be reused
across environments
- Update meson resource compilation.
- Update js.gresource.xml for new module paths.
- Update resource path references in C++.
|