aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/CodegenRust.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Auto merge of #12541 - jdm:seqseq, r=noxbors-servo2016-07-211-4/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support sequences of sequences in generated bindings. This fixes a blocker for #11897. `unroll` recursively gets the inner type of any sequence type encountered, so it's inappropriate for codegen that only wants the immediate inner type. However, if a type identifies as a sequence and is nullable, we need to reach through the nullable wrapper first. Gecko does very similar things. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #12528 (github issue number if applicable). - [X] There are tests for these changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12541) <!-- Reviewable:end -->
| * Support sequences of sequences in generated bindings.Josh Matthews2016-07-211-4/+8
| | | | | | | | unroll recursively gets the inner type of any sequence type encountered, so it's inappropriate for codegen that only wants the immediate inner type. However, if a type identifies as a sequence and is nullable, we need to reach through the nullable wrapper first. Gecko does very similar things.
* | Generate a list of supported DOM APIs from parsed WebIDLs.Josh Matthews2016-07-151-0/+34
|/
* Auto merge of #12395 - jdm:nowrap, r=Ms2gerbors-servo2016-07-121-7/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid calling JS_WrapValue for same-compartment DOM reflectors This change shaves off 15-20ns per iteration of the node.firstChild getter test in tests/html/bindings_perf.html. Based on [similar Gecko code](http://searchfox.org/mozilla-central/rev/f43c9e0ffa92e72dbdbcbf57eecf04a43d46da63/dom/bindings/BindingUtils.h#781). --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix (partially) #12358 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12395) <!-- Reviewable:end -->
| * Remove unused imports from codegen.Josh Matthews2016-07-121-7/+6
| |
* | Implement the [Exposed] extended attribute on interfaces.Ms2ger2016-07-121-16/+40
| | | | | | | | Fixes #2823.
* | Simplify CGConstructorEnabled.Ms2ger2016-07-121-16/+4
| |
* | Make DefineDOMInterface and ConstructorEnabled unsafe functions.Ms2ger2016-07-121-4/+6
| |
* | Add support for unsafe Rust-ABI functions to CGAbstractMethod.Ms2ger2016-07-121-3/+6
| |
* | Generate 'pub' before 'unsafe extern', if both are used.Ms2ger2016-07-121-3/+3
| |
* | Correct indentation in the DOMClass function.Ms2ger2016-07-121-9/+9
|/
* Auto merge of #11872 - eddyb:back-to-roots, r=Ms2gerbors-servo2016-07-041-99/+101
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace return_address usage for rooting with stack guards and convenience macros. The existing `Rooted` and `RootedVec` users were migrated the the following two macros: ```rust let x = Rooted::new(cx, value); // Was changed to: rooted!(in(cx) let x = value); // Which expands to: let mut __root = Rooted::new_unrooted(value); let x = RootedGuard::new(cx, &mut __root); ``` ```rust let mut v = RootedVec::new(); v.extend(iterator); // Was changed to: rooted_vec!(let v <- iterator); // Which expands to: let mut __root = RootableVec::new(); let v = RootedVec::new(&mut __root, iterator); ``` The `rooted!` macro depends on servo/rust-mozjs#272. These APIs based on two types, a container to be rooted and a rooting guard, allow implementing both `Rooted`-style rooting and `Traceable`-based rooting in stable Rust, without abusing `return_address`. Such macros may have been tried before, but in 1.9 their hygiene is broken, they work only since 1.10. Sadly, `Rooted` is a FFI type and completely exposed, so I cannot prevent anyone from creating their own, although all fields but the value get overwritten by `RootedGuard::new` anyway. `RootableVec` OTOH is *guaranteed* to be empty when not rooted, which makes it harmless AFAICT. By fixing rust-lang/rust#34227, this PR enables Servo to build with `-Zorbit`. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix rust-lang/rust#34227 - [x] These changes do not require tests because they are not functional changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11872) <!-- Reviewable:end -->
| * Use a stack guard and a macro for RootedVec instead of return_address.Eduard Burtescu2016-07-041-6/+4
| |
| * Switch to using the new rooted!/RootedGuard API for rooting.Eduard Burtescu2016-07-041-93/+97
| |
* | Refactor `util::prefs` operations to be methods on static struct.Corey Farwell2016-07-021-2/+2
|/
* Use ObjectOpResult::succeed.Ms2ger2016-06-271-6/+3
|
* Remove a useless local variable.Ms2ger2016-06-271-3/+1
|
* Wrap executions of Rust code called from JS in catch_unwind. Propagate the ↵Josh Matthews2016-06-221-6/+25
| | | | interrupted panic to the origin of the JS execution via TLS before resuming. Fix #6462.
* Support WindowProxy return values in bindingsJansen Jan2016-06-091-6/+12
| | | | unscopable
* Implement [Unscopable] (fixes #11583)Anthony Ramine2016-06-071-7/+26
|
* Initialise reflector earlier for globalsAnthony Ramine2016-05-271-1/+1
| | | | This allows us to use global_root_from_object in the context of a Condition.
* Implement [Func]Anthony Ramine2016-05-271-0/+3
|
* Remove utils::Prefable in favour of guard::GuardAnthony Ramine2016-05-261-14/+15
|
* Remove Prefable::terminator 🤖Anthony Ramine2016-05-261-3/+2
|
* Simplify how Prefable arrays are passed in bindings::interfaceAnthony Ramine2016-05-261-8/+3
|
* Use itertools.groupby in generatePrefableArrayAnthony Ramine2016-05-261-26/+8
|
* Make MemberCondition a function returning a plain stringAnthony Ramine2016-05-261-22/+11
|
* Move DOMString back to scriptAnthony Ramine2016-05-241-6/+3
| | | | This entirely removes the 'non-geckolib' feature of the util crate.
* Remove the custom PartialEq implementations on TypeId enumsAnthony Ramine2016-05-171-3/+1
| | | | https://github.com/rust-lang/rust/pull/33593 made them useless.
* Use JS_NewStringCopyN for the representation of interface objectsAnthony Ramine2016-05-161-4/+3
| | | | | This removes the need for the final null byte and we can make NonCallbackInterfaceObjectClass::new safe again I guess.
* Stop using JSAutoRequest.Ms2ger2016-05-131-3/+1
|
* codegen: Throw a more descriptive invalid enum messageEmilio Cobos Álvarez2016-05-131-6/+6
|
* codegen: Throw on an invalid enum value when appropiateEmilio Cobos Álvarez2016-05-131-6/+11
|
* codegen: Don't unconditionally set non-required dictionary attributesEmilio Cobos Álvarez2016-05-131-5/+14
|
* codegen: Use the non-mangled name in set_dictionary_propertyEmilio Cobos Álvarez2016-05-121-1/+1
| | | | Fixes #11152
* Auto merge of #9890 - AgostonSzepessy:update-webidl-tests, r=noxbors-servo2016-05-091-1/+1
|\ | | | | | | | | | | | | | | | | | | update.sh downloads all *.py tests from mozilla central components/script/dom/bindings/codegen/parser/update.sh downloads all *.py tests from https://dxr.mozilla.org/mozilla-central/source/dom/bindings/parser/tests <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9890) <!-- Reviewable:end -->
| * components/script/dom/bindings/codegen/parser/update.sh now downloads allAgostonSzepessy2016-03-221-1/+1
| | | | | | | | | | the latest *.py tests from https://hg.mozilla.org/mozilla-central/archive/tip.tar.gz/dom/bindings/parser/tests/
* | Auto merge of #10756 - servo:smup, r=Ms2gerbors-servo2016-05-031-61/+65
|\ \ | | | | | | | | | | | | | | | | | | | | | Update SpiderMonkey <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10756) <!-- Reviewable:end -->
| * | Update SpiderMonkeyAnthony Ramine2016-05-031-61/+65
| | |
* | | Implement hiding of interface members via Pref annotations.Josh Matthews2016-05-021-16/+97
| | |
* | | Start generating arrays of specs for easier implementation of preference checks.Josh Matthews2016-05-021-6/+14
| | |
* | | Support controlling the visibility of WebIDL interfaces via the Pref annotation.Josh Matthews2016-04-291-4/+62
|/ /
* | Refactor the `call` hook on non-callback interface objects (fixes #10744)Anthony Ramine2016-04-251-12/+12
| | | | | | | | | | | | | | | | | | | | | | It's now set through the intermediate InterfaceConstructorBehavior structure, which lets us improve the abstraction around NonCallbackInterfaceObjectClass a bit better. When the interface's constructor is supposed to always throw, the error for calling `Foo()` without new is "Illegal constructor.". when the interface actually defines an interface, the error is instead "This constructor needs to be called with `new`.".
* | Make NonCallbackInterfaceObjectClass::new unsafeAnthony Ramine2016-04-251-2/+3
| |
* | Avoid generating parameter names that are Rust keywordsKeith Yeung2016-04-171-1/+8
| |
* | remove unreachable code in codegenArnaud Marant2016-04-121-16/+0
| | | | | | | | code is unreachable after return, and identical to the upper block
* | Enable dictionaries in WebIDL sequences. Fixes #10282.Josh Matthews2016-03-301-0/+8
| |
* | Auto merge of #10152 - jdm:9511-rebase, r=noxbors-servo2016-03-241-2/+2
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | Fix #9511. Export webidl enums using "pub use". Change typedef codegen to export the underlying enum itself, rather than an alias. Works around https://github.com/rust-lang/rust/issues/31355 Rebase of #9691. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10152) <!-- Reviewable:end -->
| * Fix #9511. Export webidl enums using "pub use".Ben2016-03-231-2/+2
| | | | | | | | | | Change typedef codegen to export the underlying enum itself, rather than an alias. Works around https://github.com/rust-lang/rust/issues/31355
* | Make all interface objects share the same funToStringGuillaume Gomez2016-03-211-19/+4
|/