Commit graph

535 commits

Author SHA1 Message Date
Anthony Ramine
b094932d57 Make MemberCondition a function returning a plain string 2016-05-26 23:55:31 +02:00
Anthony Ramine
cdc7bca944 Move DOMString back to script
This entirely removes the 'non-geckolib' feature of the util crate.
2016-05-24 10:54:57 +02:00
Anthony Ramine
60aaac5175 Remove the custom PartialEq implementations on TypeId enums
https://github.com/rust-lang/rust/pull/33593 made them useless.
2016-05-17 15:30:14 +02:00
Anthony Ramine
4af3e9028d Use JS_NewStringCopyN for the representation of interface objects
This removes the need for the final null byte and we can make
NonCallbackInterfaceObjectClass::new safe again I guess.
2016-05-16 15:22:07 +02:00
Ms2ger
735480c184 Stop using JSAutoRequest. 2016-05-13 15:34:38 +02:00
Emilio Cobos Álvarez
91101f6226
codegen: Throw a more descriptive invalid enum message 2016-05-13 11:44:39 +02:00
Emilio Cobos Álvarez
e50d4b7624
codegen: Throw on an invalid enum value when appropiate 2016-05-13 11:44:38 +02:00
Emilio Cobos Álvarez
92ba0b9c39
codegen: Don't unconditionally set non-required dictionary attributes 2016-05-13 09:42:51 +02:00
Emilio Cobos Álvarez
203898c941
codegen: Use the non-mangled name in set_dictionary_property
Fixes #11152
2016-05-12 15:39:54 +02:00
bors-servo
b054cb82a6 Auto merge of #9890 - AgostonSzepessy:update-webidl-tests, r=nox
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 -->
2016-05-09 05:04:57 -07:00
bors-servo
2c69278067 Auto merge of #10756 - servo:smup, r=Ms2ger
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 -->
2016-05-03 15:46:40 -07:00
Anthony Ramine
eb94f1a918 Update SpiderMonkey 2016-05-03 18:36:11 +02:00
Josh Matthews
cb5bad63dc Implement hiding of interface members via Pref annotations. 2016-05-02 14:32:56 -04:00
Josh Matthews
88059acd7e Start generating arrays of specs for easier implementation of preference checks. 2016-05-02 14:32:55 -04:00
Josh Matthews
bb47f72f25 Support controlling the visibility of WebIDL interfaces via the Pref annotation. 2016-04-29 11:03:15 -04:00
Anthony Ramine
4c2ca7a8c9 Refactor the call hook on non-callback interface objects (fixes #10744)
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`.".
2016-04-25 11:44:59 +02:00
Anthony Ramine
a45f117838 Make NonCallbackInterfaceObjectClass::new unsafe 2016-04-25 10:51:07 +02:00
Keith Yeung
c6b6d2c84e Avoid generating parameter names that are Rust keywords 2016-04-17 19:37:42 -04:00
Arnaud Marant
315120d6e8 remove unreachable code in codegen
code is unreachable after return, and identical to the upper block
2016-04-12 19:10:10 +02:00
Josh Matthews
042883eac2 Enable dictionaries in WebIDL sequences. Fixes #10282. 2016-03-30 11:07:37 -04:00
bors-servo
edcf24fd4d Auto merge of #10152 - jdm:9511-rebase, r=nox
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 -->
2016-03-24 10:40:44 +05:30
Ben
2477f6a363 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
2016-03-23 12:49:34 -04:00
AgostonSzepessy
d3528ffce4 components/script/dom/bindings/codegen/parser/update.sh now downloads all
the latest *.py tests from
https://hg.mozilla.org/mozilla-central/archive/tip.tar.gz/dom/bindings/parser/tests/
2016-03-22 23:13:30 -04:00
Guillaume Gomez
b6feab97e0 Make all interface objects share the same funToString 2016-03-21 11:57:48 +01:00
bors-servo
c37a086660 Auto merge of #9786 - peterjoel:fix_codegen_is_array_like, r=jdm
Fixed compile error in generated code, when webidl constructors have same number of args

One of the ways that generated code differentiates constructors is by comparing if the args are array-like. The generated code was calling a function `IsArrayLike` that no longer exists. I re-implemented it with a more rust-like naming scheme.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9786)
<!-- Reviewable:end -->
2016-03-04 15:14:20 +05:30
Peter
3e78b54d46 Fixed compile error in generated code, when webidl constructors have same number of args
Edited test webidl to show issue, and fix
2016-03-03 20:21:48 +00:00
Anthony Ramine
2ed1a4ab3b Do not generate RegisterBindings::Register anymore 2016-02-25 15:56:54 +01:00
Anthony Ramine
1559f5a39f Lazily define interface objects on globals (fixes #6419) 2016-02-25 15:56:47 +01:00
Anthony Ramine
ca979e115b Cache legacy callback interface objects in proto_or_icache_array
We need them to be cached to not instantiate them multiple times with
lazy initialisation.
2016-02-25 15:15:44 +01:00
Anthony Ramine
2c4d5da866 Lazily-define standard ECMAScript classes 2016-02-25 15:15:44 +01:00
Anthony Ramine
86f3f37950 Always implement getOwnEnumerablePropertyKeys
According to JSProxy.h, without this the default implementation calls
ownPropertyKeys and filters out the unenumerable properties. We know when such
things exist so we don't need to do that.
2016-02-23 17:23:56 +01:00
Anthony Ramine
7f36247d03 Support [LegacyUnenumerableNamedProperties] 2016-02-23 17:23:51 +01:00
Anthony Ramine
cbf514d63f Fix a typo in CGDOMJSProxyHandler_getOwnPropertyDescriptor
Named properties are read-only if there is no named setter.
2016-02-23 17:23:03 +01:00
Anthony Ramine
b783d96749 Make fill_property_descriptor take a flags argument 2016-02-23 17:14:27 +01:00
Anthony Ramine
0af373cef6 Just pass global to CreateInterfaceObjects
The receiver parameter is useless here.
2016-02-23 15:42:45 +01:00
Anthony Ramine
96e28086e3 Clean up CGDOMJSClass 2016-02-23 15:42:44 +01:00
bors-servo
2676307793 Auto merge of #9633 - GuillaumeGomez:has_instance, r=nox
All interface objects now share the same hasInstance

r? @nox

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9633)
<!-- Reviewable:end -->
2016-02-19 19:49:33 +05:30
zakorgyula
6d6f23a69d Fixing issue with uniontypes not created with primitive types
refer to #9531
2016-02-18 11:08:47 +01:00
Ms2ger
eede44984d Derive the Debug trait for WebIDL-generated enums. 2016-02-17 16:29:37 +01:00
Anthony Ramine
c21a164396 Support [ExceptionClass]
Use it on DOMException.
2016-02-17 13:58:58 +01:00
Guillaume Gomez
bb9d3692c7 All interface objects now share the same hasInstance 2016-02-17 06:37:52 +01:00
Alexander Lopatin
2be49404be Fix #9508: Beautify our union enums constructors 2016-02-07 02:55:21 +03:00
bors-servo
a75f2cecda Auto merge of #9419 - psdh:includeTypedef, r=nox
generate typedefs in CodegenRust.

fixes #9384

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9419)
<!-- Reviewable:end -->
2016-01-26 22:10:57 +05:30
Prabhjyot Singh Sodhi
d6df844ae5 generate typedefs in CodegenRust 2016-01-26 21:56:44 +05:30
Michael Rosenberg
1f45eaf8a1 For WebIDL interfaces without constant members, do not generate a 'Constant' module 2016-01-26 02:50:53 -05:00
nxnfufunezn
e54929b4d7 Move ConstantSpec, NonNullJSNative and define_constants from utils to interface 2016-01-24 20:37:30 +05:30
Emilio Cobos Álvarez
950821989f webidl: Refactor isSequence in getJSToNativeConversionInfo
That way it does not depend on the return value for the same type.

This hopefully makes the code more clear, and avoids errors if something
changes in the future (for example, we could want to pass slices as
sequence arguments).
2016-01-15 14:30:38 +01:00
Emilio Cobos Álvarez
4ad1a8ddcc webidl: Implement sequences in unions
Unblocks #9053
2016-01-15 13:42:08 +01:00
Emilio Cobos Álvarez
92d7c49924 codegen: Implement WebIDL sequence arguments 2016-01-12 18:25:46 +01:00
Emilio Cobos Álvarez
2f1eee599c codegen: Move conversion behaviour to a common function 2016-01-12 18:25:46 +01:00