Граф коммитов

1127 Коммитов

Автор SHA1 Сообщение Дата
Jan de Mooij 9f57c47f87 Bug 1754405 part 13 - Move min/max int constants into PropertyKey. r=evilpie
Differential Revision: https://phabricator.services.mozilla.com/D138284
2022-02-13 12:01:48 +00:00
Jan de Mooij 4249b631d8 Bug 1754405 part 8 - Rename JSID_VOID to PropertyKey::Void(). r=evilpie
Differential Revision: https://phabricator.services.mozilla.com/D138279
2022-02-13 12:01:46 +00:00
Jan de Mooij 126599c237 Bug 1754405 part 6 - Add JS::GetWellKnownSymbolKey. r=evilpie
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
2022-02-13 12:01:45 +00:00
Jan de Mooij e508008806 Bug 1754405 part 5 - Remove INT_FITS_IN_JSID/INT_TO_JSID. r=evilpie
Differential Revision: https://phabricator.services.mozilla.com/D138276
2022-02-13 12:01:45 +00:00
Jan de Mooij db8d81dc20 Bug 1754405 part 3 - Remove JSID_IS_VOID. r=evilpie
Depends on D138273

Differential Revision: https://phabricator.services.mozilla.com/D138274
2022-02-10 09:13:18 +00:00
Chris Peterson f6fdbf028a Bug 1738401 - Remove -Wno-shadow warning suppressions. r=firefox-build-system-reviewers,glandium
-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
2021-12-01 06:40:04 +00:00
Andrew McCreight 7d01afde50 Bug 1737515 - Null check the result of XrayTraits::ensureHolder(). r=peterv
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
2021-11-01 13:37:38 +00:00
Andi-Bogdan Postelnicu 2fc4f70e9b Bug 1725145 - Preparation for the hybrid build env. r=necko-reviewers,firefox-build-system-reviewers,valentin,glandium
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
2021-08-25 10:46:17 +00:00
Tooru Fujisawa 8f6310e25c Bug 1708450 - Move call and construct functions into js/public/CallAndConstruct.h. r=nbp
Depends on D119619

Differential Revision: https://phabricator.services.mozilla.com/D119620
2021-07-13 11:52:43 +00:00
Tooru Fujisawa cc92ef732d Bug 1708448 - Move property and element functions into js/public/PropertyAndElement.h. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D119619
2021-07-13 11:52:42 +00:00
Tooru Fujisawa bf37e9d86e Bug 1708432 - Move JS_Get*PropertyDescriptor* to js/public/PropertyDescriptor.h. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D119617
2021-07-13 11:52:41 +00:00
Jan de Mooij 59f8590115 Bug 1719795 part 5 - Change JSCLASS_PRIVATE_IS_NSISUPPORTS JSClasses to use a reserved slot instead. r=mccr8,jonco
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
2021-07-13 09:31:34 +00:00
André Bargull c06f9d633b Bug 1679653 - Part 5: Add xray support for the Error cause property. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D115353
2021-06-24 16:10:39 +00:00
Tom Schuster 67961ba46a Bug 1717279 - Remove JSID_IS_SYMBOL and JSID_TO_SYMBOL. r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D118287
2021-06-21 20:56:10 +00:00
Tom Schuster 53d20836cd Bug 1713465 - Rename getterObject and setterObject. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D116314
2021-05-30 20:00:23 +00:00
Tom Schuster a1a92068a1 Bug 1713465 - Rename setGetterObject and setSetterObject. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D116313
2021-05-30 20:00:22 +00:00
Tom Schuster 054394fdf4 Bug 1713465 - Rename hasGetterObject and hasSetterObject. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D116312
2021-05-30 20:00:22 +00:00
Tom Schuster 682bd47c13 Bug 1712701 - Assert hasValue in PropertyDescriptor before allowing access to the value. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D116161
2021-05-30 18:24:40 +00:00
Jan de Mooij 1deb4708b9 Bug 1713083 part 2 - Remove JSPROP_GETTER and JSPROP_SETTER. r=evilpie
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
2021-05-27 15:03:38 +00:00
Tom Schuster b8734f0086 Bug 1712720 - Remove PropertyDescriptor hasGetterOrSetter. r=jandem
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
2021-05-25 16:06:55 +00:00
Andi-Bogdan Postelnicu 1cf28e7475 Bug 1519636 - Reformat recent changes to the Google coding style. r=emilio
Updated with clang-format version 12.0.0 (taskcluster-KEgO7qdgQ8uaewA6NkRnRA)

Differential Revision: https://phabricator.services.mozilla.com/D115804
2021-05-24 15:08:47 +00:00
Tom Schuster 8076edbe6f Bug 1710126 - Make PropertyDescriptor attrs private. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D114636
2021-05-11 11:03:24 +00:00
Tom Schuster a2dce1438e Bug 1708698 - Use Maybe<PropertyDescriptor> for Xray resolveOwnProperty and a lot of related code. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D113976
2021-05-07 12:29:05 +00:00
Tom Schuster 57af1b0154 Bug 1706404 - Use Maybe<PropertyDescriptor> more in XPConnect. r=smaug
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
2021-04-29 19:16:43 +00:00
Dorel Luca 1ed1bb14ee Backed out 3 changesets (bug 1706404) for Linting failures in builds/worker/checkouts/gecko/dom/bindings/Codegen.py. CLOSED TREE
Backed out changeset 5ecbe2eb1d25 (bug 1706404)
Backed out changeset b50507879a6b (bug 1706404)
Backed out changeset b0c0700ce719 (bug 1706404)
2021-04-29 21:31:09 +03:00
Tom Schuster 16727033d9 Bug 1706404 - Use Maybe<PropertyDescriptor> more in XPConnect. r=smaug
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
2021-04-29 17:36:49 +00:00
Tom Schuster b728526ade Bug 1704293 - Use Maybe<PropertyDescriptor> for BaseProxyHandler::getOwnPropertyDescriptor in DOM and XPConnect. r=jandem,smaug
Differential Revision: https://phabricator.services.mozilla.com/D112037
2021-04-19 19:51:59 +00:00
Tom Schuster cf21f18c06 Bug 1701904 - Add methods directly on PropertyDescriptor. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D110229
2021-03-30 18:48:49 +00:00
Jan de Mooij df5c2e2c5e Bug 1674777 part 10 - Fix XPConnect callers for JS_GetTypedArrayLength returning size_t. r=kmag
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
2021-02-10 11:22:59 +00:00
Simon Giesecke ee949b8e10 Bug 1678374 - Reduce dependencies on js, in particular on jsfriendapi.h. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D97617

Depends on D97616
2020-11-23 16:12:19 +00:00
Ricky Stewart 02a7b4ebdf Bug 1654103: Standardize on Black for Python code in `mozilla-central`.
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
2020-10-26 18:34:53 +00:00
Bogdan Tara da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart c0cea3b0fa Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
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
2020-10-23 20:40:42 +00:00
Dorel Luca 1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart 50762dacab Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
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
2020-10-21 21:27:27 +00:00
Bobby Holley 80dc7d0169 Bug 1669556 - Simplify FilteringWrapper. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D92683
2020-10-07 20:06:13 +00:00
Bobby Holley ca99f17aad Bug 1669556 - Simplify PreCreate handling WrapperFactory. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D92682
2020-10-07 20:06:06 +00:00
Bobby Holley 347101914e Bug 1669556 - Remove XrayUtils::HasNativeProperty. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D92681
2020-10-07 20:06:03 +00:00
André Bargull 7e04b39310 Bug 1668785: Remove using declarations from namespace level in Proxy.h. r=mgaudet
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
2020-10-02 12:51:03 +00:00
Simon Giesecke de7bab0f06 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
Jeff Walden 6d5beafab1 Bug 1663365 - Move various Object-related functions to a new js/public/Object.h header. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D89333
2020-09-08 22:55:38 +00:00
Jeff Walden 5608660da2 Bug 1663365 - Move |XrayJitInfo| functionality to its own friend header. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D89331
2020-09-08 22:51:10 +00:00
Matthew Gaudet f1e25e9043 Bug 1654851 - Correctly handle transplanting objects with private fields r=jorendorff,extension-reviewers,zombie
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
2020-08-11 21:35:40 +00:00
Sylvestre Ledru 843f943758 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D85678
2020-08-02 15:29:15 +00:00
Jeff Walden e8f3f74ef6 Bug 1656411 - Move typed array, ArrayBuffer, and dataview-related functions out of jsfriendapi.h to two new headers. r=mgaudet,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D85524
2020-07-31 16:37:27 +00:00
Jeff Walden c9ab0ce005 Bug 1656411 - Move WindowProxy-related functions out of jsfriendapi.h to their own header. r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D85521
2020-07-31 16:11:36 +00:00
Jon Coppeard 3cd1ede76a Bug 1648453 - Fix build errors caused by MacOS headers defining check macro r=smaug
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
2020-07-17 17:36:04 +00:00
Razvan Maries 6767314b95 Backed out 4 changesets (bug 1648453) for hazzard bustages on CycleCollectedJSContext.cpp. CLOSED TREE
Backed out changeset 9598a75cca47 (bug 1648453)
Backed out changeset 473e7d55a25e (bug 1648453)
Backed out changeset 0afcee198ecd (bug 1648453)
Backed out changeset 623252539387 (bug 1648453)
2020-07-17 00:01:11 +03:00
Jon Coppeard f283a08ed4 Bug 1648453 - Fix build errors caused by MacOS headers defining check macro r=smaug
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
2020-07-16 15:37:42 +00:00
Simon Giesecke cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00