It's very common to call JS::GetWellKnownSymbol and then creating a PropertyKey.
We can make this a bit more ergonomic with this API.
Differential Revision: https://phabricator.services.mozilla.com/D138277
-Wshadow warnings are not enabled globally, so these -Wno-shadow suppressions have no effect. I had intended to enable -Wshadow globally along with these suppressions in some directories (in bug 1272513), but that was blocked by other issues.
There are too many -Wshadow warnings (now over 2000) to realistically fix them all. We should remove all these unnecessary -Wno-shadow flags cluttering many moz.build files.
Differential Revision: https://phabricator.services.mozilla.com/D132289
XrayTraits::ensureHolder() can return the result of XrayTraits::createHolder(),
which in turns returns the result of JS_NewObjectWithGivenProto(),
so we need to null check the result. The other callers already do this.
Differential Revision: https://phabricator.services.mozilla.com/D129432
Automatically generated path that adds flag `REQUIRES_UNIFIED_BUILD = True` to `moz.build`
when the module governed by the build config file is not buildable outside on the unified environment.
This needs to be done in order to have a hybrid build system that adds the possibility of combing
unified build components with ones that are built outside of the unified eco system.
Differential Revision: https://phabricator.services.mozilla.com/D122345
This is a step towards removing object private slots.
Classes with JSCLASS_PRIVATE_IS_NSISUPPORTS now use JSCLASS_SLOT0_IS_NSISUPPORTS
instead. For most classes this means we need to add an extra reserved slot and remove
the private slot.
Global objects (SimpleGlobalObject and the XPConnect BackstagePass and Sandbox globals)
however can use the JSCLASS_GLOBAL_APPLICATION_SLOTS already there. These slots were
only used for WebIDL DOM globals until now.
Differential Revision: https://phabricator.services.mozilla.com/D119502
We now set the descriptor's getter or setter when the corresponding argument
to DefineAccessorProperty is non-nullptr.
Usually the flag was passed only if the corresponding object argument was non-nullptr,
so there's no change in behavior for those.
The exception is `Console::PopulateConsoleNotificationInTheTargetScope` where we passed
JSPROP_SETTER with a nullptr setter. Changing this is likely okay; it shouldn't make a
difference for new properties anyway.
Note that code can still use the richer PropertyDescriptor API to set nullptr
getters/setters explicitly.
Differential Revision: https://phabricator.services.mozilla.com/D116091
Using isAccessorDescriptor is actually a very minor behavior change,
because this also applies to {get: undefined, set: undefined}.
Differential Revision: https://phabricator.services.mozilla.com/D115880
The current defineProperty code sadly uses existing_desc.object() to check
if the property is being defined would shadow an own property.
All of this code is not really something that we should be doing, but I am not even sure how we would replace GetPropertyDescriptor
with GetOwnPropertyDescriptor here.
Depends on D113661
Differential Revision: https://phabricator.services.mozilla.com/D113662
The current defineProperty code sadly uses existing_desc.object() to check
if the property is being defined would shadow an own property.
All of this code is not really something that we should be doing, but I am not even sure how we would replace GetPropertyDescriptor
with GetOwnPropertyDescriptor here.
Depends on D113661
Differential Revision: https://phabricator.services.mozilla.com/D113662
For enumerateNames on Xrays, throw an OOM exception upfront. This matches what we do
inside the JS engine when enumerating large typed arrays.
Differential Revision: https://phabricator.services.mozilla.com/D103902
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
The `using` declarations in "Proxy.h" make it act like a second
"NamespaceImports.h", introducing names from `JS` into the `js` namespace.
Remove the `using` declarations from "Proxy.h" and then fix up the breakage by:
- Prepend `JS::` in various header files.
- Add "NamespaceImports.h" in cpp files.
- Add `PropertyDescriptor` to "NamespaceImports.h". There are many unqualified
references to `PropertyDescriptor`, making it a prime candidate for
"NamespaceImports.h".
Drive-by changes:
- Use local variables in `CheckProxyFlags()` to make the `static_assert`
conditions more readable.
Differential Revision: https://phabricator.services.mozilla.com/D92207
As part of DOM node adoption they are transplanted, and their expando chains are copied over.
This copying uses JS_CopyPropertiesFrom, which until this patch, cannot see
private fields as they are excluded from property iteration. This patch adds
property iteration for private fields, and renames JS_CopyPropertiesFrom to
JS_CopyOwnPropertiesAndPrivateFields which is more accurate.
The users of this method are all doing object manipulation in ways where
preserving the copied private field is the better default.
In addition to testing DOM nodes explicitly, this patch also adds a jit-test
which uses transplantableObject to test similar things with FakeDOMObjects.
Differential Revision: https://phabricator.services.mozilla.com/D84737
These patches have triggered a case where a MacOS header defines 'check' as a macro which then conflicts with use of 'check' as a method name in AccessCheck.h, probably due to unified builds.
This was fixed independently in a couple of places before, but I think it makes sense to move the fix to AccessCheck.h itself.
Differential Revision: https://phabricator.services.mozilla.com/D83796
These patches have triggered a case where a MacOS header defines 'check' as a macro which then conflicts with use of 'check' as a method name in AccessCheck.h, probably due to unified builds.
This was fixed independently in a couple of places before, but I think it makes sense to move the fix to AccessCheck.h itself.
Differential Revision: https://phabricator.services.mozilla.com/D83796