aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_module.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove deprecated remove function (#31213)Taym Haddadi2024-01-301-1/+3
|
* rustdoc: Fix many rustdoc errors (#31147)Martin Robinson2024-01-221-13/+13
| | | | This fixes many rustdoc errors that occur due to raw URLs in rustdoc comments as well as unescaped Rust code that should be in backticks.
* Replace script_plugins with a clippy like rustc driver (named crown) (#30508)Samson2023-12-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove script_plugins * Use crown instead of script_plugins * crown_is_not_used * Use crown in command base * bootstrap crown * tidy happy * disable sccache * Bring crown in tree * Install crown from tree * fix windows ci * fix warning * fix mac libscript_plugins.dylib is not available anymore * Update components/script/lib.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> * Update for nightly-2023-03-18 Mostly just based off https://github.com/servo/servo/pull/30630 * Always install crown it's slow only when there is new version * Run crown test with `mach test-unit` * Small fixups; better trace_in_no_trace tests * Better doc * crown in config.toml * Fix tidy for real * no sccache on rustc_wrapper * document rustc overrides * fixup of compiletest * Make a few minor comment adjustments * Fix a typo in python/servo/platform/base.py Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com> * Proper test types * Ignore tidy on crown/tests --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Use Foo_Binding instead of FooBinding for namespace modules (#30447)Samson2023-09-301-1/+1
| | | | | * Update Codegen.py to emit Foo_Binding instead of FooBinding * s/FooBinding/Foo_Binding/g
* Update mozjs to a version that includes SpiderMonkey ESR 115 (#30379)Samson2023-09-201-34/+10
| | | | | | | | | | | | | | | * Update mozjs to sm115 * fix module stuff https://phabricator.services.mozilla.com/D163949 * fix always allow cloning https://bugzilla.mozilla.org/show_bug.cgi?id=1774866 * Update expectations toStringTag now works on wasm object due to SM bump
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-49/+46
| | | | | * strict imports formatting * Reformat all imports
* remove `extern crate` (#30311)Samson2023-09-081-0/+1
| | | | | | | | | | | * remove extern crate * Update components/script_plugins/lib.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Use mozjs tracing infrastructure (#29918)Samson2023-08-101-0/+1
| | | | | | | * Update mozjs https://github.com/servo/mozjs/commit/64711ec2e6dc4595df691bffc7f1e5052ab86c8d also fixes https://github.com/servo/servo/issues/30043 * Move to mozjs Traceable and introduce CustomTraceable
* No tracing of nop traceable fields (#29926)Samson2023-08-041-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add `no_trace` option to JSTraceable derive * NoTrace wrapper * Port some types to no_trace schematics * Fixing my unsafe mistakes (not tracing traceables) * Add docs & safety guards for no_trace Safety guards (trait shenanigans) guarantees safety usage of `no_trace` * Port canvas_traits to no_trace * Port servo_media to no_trace * Port net_traits to no_trace * Port style to no_trace * Port webgpu to no_trace * Port script_traits to no_trace * Port canvas_traits, devtools_traits, embedder_traits, profile_traits to no_trace * unrooted_must_root lint in seperate file * Add trace_in_no_trace_lint as script_plugin * Composable types in must_not_have_traceable * Introduced HashMapTracedValues wrapper * `HashMap<NoTrace<K>,V>`->`HashMapTracedValues<K,V>` * Port rest of servo's types to no_trace * Port html5ever, euclid, mime and http to no_trace * Port remaining externals to no_trace * Port webxr and Arc<Mutex<_>> * Fix spelling in notrace doc
* Fix formatting.Josh Matthews2023-05-201-10/+3
|
* Remove global argument from Promise::new_in_current_realm.Josh Matthews2023-05-201-2/+2
|
* Make GlobalScope.get_cx a static method.Josh Matthews2023-05-201-30/+33
|
* Format.Josh Matthews2022-11-231-10/+13
|
* Trigger new module error reporting behaviour.Josh Matthews2022-11-231-27/+32
|
* Changes for spidermomkey upgrade.Josh Matthews2022-11-231-23/+31
|
* Don't hardcode string types.Josh Matthews2021-05-141-2/+2
|
* fmtsagudev2021-03-131-1/+1
|
* Fix ModuleEvaluatesagudev2021-03-131-2/+3
|
* Formatingsagudev2021-03-121-1/+1
|
* Fix errorssagudev2021-03-121-4/+4
|
* Update mozjs.Josh Matthews2021-02-181-11/+23
|
* ran mach tidySudarsan2020-08-281-1/+0
|
* Update mozjs to 0.14.1Sudarsan2020-08-281-3/+1
| | | | | | | This update pulls in improvements on mozjs that now removes the need to pass pointers to CompileOptionsWraper::new(), allows NewProxyObject to now accept a Singleton bool and JSClass and removes an unsafe Handle::new usage.
* Removed unnecessary conversion from UTF-8 to UTF-16Arjun Ramachandrula2020-07-271-6/+4
|
* Auto merge of #27026 - CYBAI:dynamic-module, r=jdmbors-servo2020-07-191-54/+458
|\ | | | | | | | | | | | | | | | | | | Introduce dynamic module --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #25439 - [x] There are tests for these changes
| * Handle script private reference hooks properlyCYBAI2020-07-181-3/+21
| |
| * Set private reference for classic scriptCYBAI2020-07-181-22/+54
| | | | | | | | | | | | | | | | | | | | | | | | Web developers can use `Dynamic Import` in a classic script; thus, we need to save the script's private reference so that we can reuse it when we're going to fetch a dynamic import module for a classic script. Besides, because it's possible to use different executing context for a dynamic import module (like `dynamic-import/string-compilation-other-document.html` WPT test), we can't initialize a module owner at the timing of `SetScriptPrivate`; thus, if the private module script doesn't hold an owner, we'll use a DynamicImport owner for it.
| * checkpoint - dynamic load inside of a module and classic script works.Josh Matthews2020-07-181-45/+399
| |
* | Auto merge of #27303 - camelid:async-to-asynch, r=jdmbors-servo2020-07-171-3/+3
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use `asynch` instead of `r#async` <!-- Please describe your changes on the following line: --> This is a vestige of the transition from 2015 to 2018 edition Rust. `async` was added as a keyword in 2018 edition Rust, so `cargo fix` changed the variable name here to `r#async`. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because this is just an internal name change <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
| * Use `asynch` instead of `r#async`Camelid2020-07-161-3/+3
| | | | | | | | | | | | This is a vestige of the transition from 2015 to 2018 edition Rust. `async` was added as a keyword in 2018 edition Rust, so `cargo fix` changed the variable name here to `r#async`.
* | Use `Rc` instead of cloning the `DOMString`Camelid2020-07-141-9/+9
|/ | | | | | | | | | Specifically, I changed the `text` field of `ScriptOrigin` from a `DOMString` to an `Rc<DOMString>`. Then I updated all the related code to work with an `Rc`. This is just a first pass to get the code to compile. There are probably more things I can do that will improve the code and further reduce cloning.
* Rollback to recursively check dependency statusCYBAI2020-06-231-105/+42
| | | | | | | | | | | | | | | | | | | | | | | | | In https://github.com/servo/servo/pull/26395/files#diff-3fe97584f564214ec8e7ebbf91747e03L253-R318, we moved from `recursive checking` of dependency status to check only the _current module_'s dependency status and its descendant dependency status and also circular dependency status. However, it will cause an issue. For example, if the module dependency is like following ``` a -> b -> c -> d -> e f -> g -> h -> c -> d -> e ``` In this example, if the d module is still under fetching but g is trying to advance to finish. Then, it will cause a panic because module d is g's grand-grand-grand-descendant which means it's still under fetching and we can't instantiate module g. Ideally, we should get rid of the checking in #26903 so, before #26903 fixed, we can just move back to the recursive checking way which will ensure all descendants are not fetching.
* Use global.get_referrer() when appropiateMatthias Deiml2020-06-171-7/+2
|
* Make url for "client" referrer mandatoryMatthias Deiml2020-06-171-4/+6
|
* Move away from Promise.all way and check if we need to finish manuallyCYBAI2020-06-131-587/+531
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the previous Promise.all way, we registered a promise for every module script which means we will need to do many complex checkings like "is this top level?" and it will make us much more difficult to understand how the module script algorithm works. In the new manual checking way, we will only register promises for top level modules to notify its owner (e.g. the script element) to finish the load. So, we can understand it much more easily and would be more spec-aligned. Also, I think the `Ready` and `FetchFailed` status are quite confusing and we actually don't need them so they're removed in this patch. Then, we will always go to `Finished` instead. It would basically be following steps: +-----------------+ | Failed to fetch | ----------+ +--------------+ +----------+ / +-----------------+ | | Fetch module | ----> | Fetching | ---+ v +--------------+ +----------+ \ +---------+ +---------------------+ | Fetched | | Advance to Finished | +---------+ +---------------------+ | ^ v | +-------------------+ | | Fetch descendants | ----- if no descendants +-------------------+ | V +----------------------+ | Fetching Descendants | +----------------------+ In `Advance to Finished`, it means that module script is about to finished so it will 1. Notify all of its `ready` and `not finished` parents to finish 2. Link (instantiate) the module 3. Resolve its promise to notify owner(s) to finish
* require entered realm, use aes, to append native promise handlerGregory Terzian2020-06-041-10/+10
|
* integrate readablestream with fetch and blobGregory Terzian2020-06-041-1/+1
|
* Introduce import.meta hook for module scriptCYBAI2020-05-171-1/+35
|
* Add InRealm argument to Callback traitTipowol2020-04-051-1/+1
|
* Use mozjs exposed function to generate SourceTextCYBAI2020-03-311-14/+3
|
* Update SpiderMonkeyAnthony Ramine2020-03-061-26/+31
|
* Use `essence` algorithm from mime crateCYBAI2020-03-021-7/+14
|
* Always pass InRealm to GlobalScope::from_context to avoid getting null globalCYBAI2020-02-161-2/+5
|
* rename compartment to realmKunal Mohan2020-01-241-8/+8
|
* Auto merge of #25552 - CYBAI:fix-25436, r=jdmbors-servo2020-01-201-3/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Return the highest priority error from the descendant instead of return the very first one The test failed because we didn't return the highest priority error (which is network error in this case). As Manish mentioned in https://github.com/servo/servo/issues/25436#issuecomment-571065323, that's because we're using the Promise.all trick to signal loads. If we can avoid relying on Promise.all, maybe we don't need to do a complex logic like this; instead, ideally, we should always finish the module load immediately when we hit network failure so that we don't even need to do the `max()` comparison. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #25436 - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
| * Return the highest priority error from the descendant instead of return the ↵CYBAI2020-01-201-3/+4
| | | | | | | | very first one
* | Modify `script` to prevent further violations of snake_caseKunal Mohan2020-01-181-2/+2
|/
* Fix module script MIME check to not include paramsManish Goregaokar2020-01-061-2/+11
| | | | Also makes it error when there is no MIME type available.
* Upgrade module fail warning log to errorManish Goregaokar2020-01-061-1/+1
|
* Remove redundant checking of promise resolve and clone of URLsCYBAI2020-01-061-20/+4
|