Commit graph

129 commits

Author SHA1 Message Date
Ms2ger
00a4a4eb02 servo: Merge #2167 - Introduce a get_dictionary_property function to reduce duplicated code in (from Ms2ger:get_dictionary_property); r=jdm
...the dictionary conversion codegen.

This also explicitly disallows dictionary members without a default value, as
the code for those doesn't currently compile.

This is the second step of my planned rewrite of the dictionary initialization
that will remove the default values we currently use to initialize the
dictionary struct in the 'new' function.

Source-Repo: https://github.com/servo/servo
Source-Revision: 28d481664c3b45a20f0825c3fb6c79c9eba7140f
2014-04-18 14:34:10 -04:00
Ms2ger
4fcb54bdf3 servo: Merge #2164 - Merge the 'new' and 'Init' functions for dictionaries (from Ms2ger:dictionary-init); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: e332f2f0fec23b2318589b08c2a1e8fb1557e672
2014-04-18 12:58:04 -04:00
Ms2ger
acb91e47c5 servo: Merge #2156 - Remove some dead code from codegen as found by pyflakes (from Ms2ger:codegen-deadcode); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 58efe0bf7586f175ac4323ab234e8f6ef53a6f7d
2014-04-18 10:28:11 -04:00
Ms2ger
34326f441a servo: Merge #2155 - Improve and test dictionary codegen (from Ms2ger:dictionary-codegen); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 099815683d11ffa1fbd91cf39b4aca14cc901632
2014-04-18 09:40:11 -04:00
Ms2ger
874facc2d7 servo: Merge #2154 - Improve codegen for enums (from Ms2ger:enumerated-codegen); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 15e0b487287ff47e0ecfe13c7fc442033ef71814
2014-04-18 09:16:16 -04:00
Josh Matthews
c0df29bf3a servo: Merge #2147 - Add transparent Traceable and Untraceable types to aid proper rooting pr (from jdm:untraceable); r=Ms2ger
...actices, and replace ad-hoc Untraceable structs with empty Encodable implementations.

Source-Repo: https://github.com/servo/servo
Source-Revision: 0b1c8bf8d6a628c9483e94f048d1ff95e65d5da8
2014-04-17 18:04:10 -04:00
Ms2ger
61452fba3b servo: Merge #2143 - Ensure that optional primitive arguments aren't treated as nullable (from Ms2ger:optional-primitives); r=jdm
By forgetting the Some(), we caused type inference to convert to Option<T>
for optional non-nullable primitive arguments, and to Option<Option<T>> for
optional nullable primitive arguments (essentially the same thing). This
change brings the primitive codegen in line with the DOMString codegen.

Using distinct types for optionality and nullability would have prevented
this issue.

Source-Repo: https://github.com/servo/servo
Source-Revision: 3478105da9ed1503a60b2fadf71be95647aa7e9d
2014-04-17 10:40:15 -04:00
Ms2ger
a0af8d50e0 servo: Merge #2126 - Remove unwrap_object (from Ms2ger:avoid-unwrap_object); r=jdm
There is no good reason to have both unwrap_object and unwrap_jsmanaged.
Removing unwrap_object simplifies the codegen and makes further
simplifications easier.

Source-Repo: https://github.com/servo/servo
Source-Revision: aacf261bb4903b45bc40c5e68648f7056467d93a
2014-04-16 08:13:13 -04:00
Ms2ger
aa5f26a57c servo: Merge #2112 - Implement FromJSValConvertible for JS<T> (from Ms2ger:IDLInterface-JS); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 7149a25e91695465321371a4f235d2951c6212fe
2014-04-16 04:22:11 -04:00
Ms2ger
9c2849ae0c servo: Merge #2114 - Remove unused variable 'obj' from binding functions (from Ms2ger:unused-obj-local-arg); r=jdm
This removes the local variable and prefixes the argument with an underscore.
Neither is used right now.

Source-Repo: https://github.com/servo/servo
Source-Revision: e4f33eb9b9c51a79c0948d187afbf41aedb7280b
2014-04-15 12:22:44 -04:00
Ms2ger
c34826a79f servo: Merge #2113 - Remove the return value from DefineDOMInterface (from Ms2ger:DefineDOMInterface); r=jdm
This moves the assertion from its only caller into the function itself, to
clarify that we don't intent to deal with any failure here.

Source-Repo: https://github.com/servo/servo
Source-Revision: 613e8dfaf24cf1043a7fa8517b07660ad845be86
2014-04-15 11:52:28 -04:00
Ms2ger
871f13d3f1 servo: Merge #2093 - Remove DOMObjectPointerType (from Ms2ger:DOMObjectPointerType); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 0c4354a43931db40afd1ecb7bd49f51aaa9ccf72
2014-04-10 15:16:17 -04:00
Ms2ger
ca81421b61 servo: Merge #2091 - Make GetCallableProperty more rustic (from Ms2ger:GetCallableProperty); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 4683788600a8acf0f77d81117c6b1bcf1a1a618f
2014-04-10 13:58:18 -04:00
Ms2ger
ef67f12f5f servo: Merge #2088 - Use ToJSValConvertible for all conversions to JSVal (from Ms2ger:global-ToJSValConvertible); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 986664f52780481a8e875692331179c956627cb1
2014-04-10 12:43:23 -04:00
Josh Matthews
f202bb2bf3 servo: Merge #2058 - Remove all traces of C wrappers for SpiderMonkey class stubs (from jdm:rmcrust); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: aa36ae62cd8f881e901f3657cb228dc2e4480e1f
2014-04-08 11:13:12 -04:00
Ms2ger
3c4a17de65 servo: Merge #2051 - Remove a little more xray-related code (from Ms2ger:more-xray); r=jdm
On top of #2050

Source-Repo: https://github.com/servo/servo
Source-Revision: 7541b5752642a96a9f860f4115681af211c897e1
2014-04-07 13:01:16 -04:00
Sankha Narayan Guria
e5c1703a35 servo: Merge #2050 - Remove XRay related stuff from codegen (fixes #1936) (from sankha93:rmxray); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 86c83f7bfc2c748047dbd9b2d4b788e77714c980
2014-04-06 17:04:26 -04:00
Ms2ger
3a82c9b491 servo: Merge #2049 - WebIDL enum cleanup (from Ms2ger:enum-jsval); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 68385dfde6c17e282667213dc04ef8232b584f98
2014-04-06 15:31:30 -04:00
Josh Matthews
a3b4dbff7f servo: Merge #2041 - Upgrade rust (from servo:rustup_20140321b); r=larsbergstrom
Source-Repo: https://github.com/servo/servo
Source-Revision: 83aabe327d3b713581a4183b7f23cea0c39a94c9
2014-04-04 18:52:50 -04:00
Tetsuharu OHZEKI
480bebdf6b servo: Merge #1947 - Annotate 'inline' to TCast::to/to_unchecked (from saneyuki:cast); r=jdm
follow up https://github.com/mozilla/servo/pull/1864#issuecomment-37109672

Source-Repo: https://github.com/servo/servo
Source-Revision: e67d8a4003738a95d769ee562b3d45de1be279c2
2014-03-23 11:46:47 -04:00
lpy
59cb6f828f servo: Merge #1967 - Remove |unused| field from DOMClass.(fixes #1960) (from lpy:issue1960); r=Ms2ger
see #1960

Source-Repo: https://github.com/servo/servo
Source-Revision: 21dc875708afbfa8c69442ff5394067a47f1e9f8
2014-03-22 16:43:52 -04:00
Ms2ger
03a48a0d31 servo: Merge #1950 - Fix code generation for a null default value for nullable string arguments (from Ms2ger:nullable-string-with-null-default); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 54da52fa774ce2ee59fcf811af595bf292169ad8
2014-03-21 06:49:34 -04:00
Ms2ger
931e08e4c8 servo: Merge #1951 - Remove support for non-castable arguments (from Ms2ger:castable); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 5dbde0c5c5e60f41263246e79369748fb2493d65
2014-03-20 23:13:34 -04:00
Ms2ger
3eddd3071d servo: Merge #1949 - Cleanup codegen (from Ms2ger:cleanup-codegen); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 7bfb15ec624755ca3c87c5e19ab9c4762205c574
2014-03-20 17:07:28 -04:00
Tetsuharu OHZEKI
cb6991627c servo: Merge #1864 - Split TCast::to into TCast::to_unchecked and TCast::to (from saneyuki:split_cast_to); r=jdm
fix #1836

Source-Repo: https://github.com/servo/servo
Source-Revision: 831712206865e2c0516009b16e2ac60f754dd1a8
2014-03-20 10:58:36 -04:00
lpy
83328e8fb2 servo: Merge #1943 - Force infallible binding methods to return void.(fixes #1933) (from lpy:issue1933); r=jdm
see #1933

Source-Repo: https://github.com/servo/servo
Source-Revision: 2fb8c84baceee09c2127898cd7f9d3a8e0011cce
2014-03-20 10:19:30 -04:00
Ms2ger
562cc53776 servo: Merge #1945 - Pass the isDefinitelyObject argument to wrapObjectTemplate (from Ms2ger:1196-isDefinitelyObject); r=jdm
... and fix nearby whitespace (fixes #1196).

Source-Repo: https://github.com/servo/servo
Source-Revision: 9e53b4d828f9cf9af560a4f9106e474eadfa3fa1
2014-03-20 09:40:32 -04:00
lpy
34aa1806b4 servo: Merge #1944 - Rename squirrel_away_unboxed to squirrel_away_unique.(fixes #1938) (from lpy:issue1938); r=Ms2ger
see #1938

Source-Repo: https://github.com/servo/servo
Source-Revision: 19a7c429a1eea7b80cefb4b72138fafecc9b924a
2014-03-20 06:34:32 -04:00
Ms2ger
7762e1fe18 servo: Merge #1909 - Pass Option<T> for optional primitive arguments without a default value (from Ms2ger:optional-defaults); r=jdm
...(fixes #1813).

Source-Repo: https://github.com/servo/servo
Source-Revision: ad826efd6d31a81033261b3e038c3e6c3c094629
2014-03-19 23:55:40 -04:00
Ms2ger
ff6b7efa76 servo: Merge #1915 - Return a JS<T> from *Binding::Wrap rather than a JSObject (from Ms2ger:wrap-return-js); r=jdm
This lets us avoid the sketchy tricks in JS::new and Window::new, where we
kept an unsafe pointer to the native object across the Wrap call that
consumed the owned pointer.

Source-Repo: https://github.com/servo/servo
Source-Revision: 7f188500a12373677c7ef9feb999276c30f1068a
2014-03-19 19:01:48 -04:00
Ms2ger
670ef8d16b servo: Merge #1910 - Remove a dead argument from CGAbstractMethod methods (from Ms2ger:dead-arg-CGAbstractMethod); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 26f9543e60414d5ff3890d36c5370d0804c2cf18
2014-03-19 18:37:51 -04:00
Lars Bergstrom
382dd8c9ba servo: Merge #1934 - Rust upgrade (from larsbergstrom:rust_20140224_squashed); r=jdm
For review only - don't approve yet (need to squash and land submodule updates first).

critic? @metajack

Source-Repo: https://github.com/servo/servo
Source-Revision: f7aa6e3d9b8bfcc0565624f1094241b3b8658bd8
2014-03-19 12:35:17 -04:00
Tetsuharu OHZEKI
69546e0e5e servo: Merge #1929 - Use 'TConstants' instead of magic numbers (from saneyuki:const); r=Ms2ger
We can use `TConstants` instead of by #1914 fixed.

Source-Repo: https://github.com/servo/servo
Source-Revision: caf1ed94468da3c134cc8e8f4a1b934bb353dc19
2014-03-16 04:35:14 -04:00
Tom Schuster
c8a7a7bafe servo: Merge #1914 - Implement named constants in bindings (from evilpie:constants); r=Ms2ger
Generated code looks like this:

```rust
pub mod UIEventConstants {
  static SCROLL_PAGE_UP: i32 = -32768;
  static SCROLL_PAGE_DOWN: i32 = 32768;
} // mod UIEventConstants
```

Source-Repo: https://github.com/servo/servo
Source-Revision: 082de0e2527238864334dbcbe0d8aa0a9fac2e23
2014-03-15 17:56:23 -04:00
Ms2ger
318a35fbf5 servo: Merge #1895 - Remove support for returning values through outparams (from Ms2ger:outparams); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 3933d17262de06458e1d79217d5a7810c4154611
2014-03-13 07:13:35 -04:00
Ms2ger
61d9ab9d4c servo: Merge #1887 - Merge CGThing.declare and CGThing.define (from Ms2ger:merge-declare-define); r=jdm
This distincion is carried over from the C++ codegen, but it has no meaning
in Rust.

Source-Repo: https://github.com/servo/servo
Source-Revision: 7b8a0fd2a39cfcdb52965694ae83df7731c80abf
2014-03-11 16:55:44 -04:00
Ms2ger
8d5c3fc977 servo: Merge #1875 - Completely rewrite the code to convert JSVals to unions (from Ms2ger:unions); r=jdm
This code works correctly for the two unions currently in use, and raises
exceptions in codegen for most other cases. I will implement those cases when
the need arises.

Source-Repo: https://github.com/servo/servo
Source-Revision: 8c1f6bc72dc2435445b3bb880e470a957aa1ff95
2014-03-11 14:52:45 -04:00
Ms2ger
8ebc89a23d servo: Merge #1878 - Replace GetReflector by an implementation of ToJSValConvertible (from Ms2ger:GetReflector); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 8e16c003678c4c5d8161cfbc71989a617e26c3f2
2014-03-11 12:31:51 -04:00
Ms2ger
bbe1ef9028 servo: Merge #1883 - Cleanup codegen (from Ms2ger:cleanup-codegen); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: d004e433313a008b69a3a60c848006b8ef435327
2014-03-11 10:10:54 -04:00
Ms2ger
65ec7c0293 servo: Merge #1877 - Remove code from codegen that is nowhere close to working (from Ms2ger:dead-codegen-code); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 92f295bc07a783ac878005bc76da0c10a6e41bbf
2014-03-10 15:37:51 -04:00
Ms2ger
723babdcd9 servo: Merge #1876 - Do DOMString conversions through {From,To}JSValConvertible (from Ms2ger:JSValConvertible-strings); r=jdm
Hat tip to @eddyb and @huonw for most of the clever bits of this PR.

Source-Repo: https://github.com/servo/servo
Source-Revision: af29237371f4a7927dcae614108be07bbab6ad3d
2014-03-10 15:13:52 -04:00
Ms2ger
8eab9c241c servo: Merge #1861 - Split JSValConvertible into two traits (from Ms2ger:split-JSValConvertible); r=jdm
Later, we'll want to implement variations of the conversion *from* JS, but
not the conversion *to* JS.

Source-Repo: https://github.com/servo/servo
Source-Revision: 52ab85c45d57dbee88f5080b2d8ee19c6ea9aebd
2014-03-10 11:01:52 -04:00
Ms2ger
0728d02843 servo: Merge #1868 - Use the improved JSVal interfaces (from Ms2ger:JSVal); r=jdm
Requires https://github.com/mozilla-servo/rust-mozjs/pull/54.

Source-Repo: https://github.com/servo/servo
Source-Revision: 654f3db29511d3b7b7a49a875b86a8538d111bcf
2014-03-10 10:22:51 -04:00
Ms2ger
53c63cf25b servo: Merge #1856 - Remove a pointless argIsPointer local variable (from Ms2ger:argIsPointer); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 636ae6e7620f3699532b7103cac024a498613660
2014-03-07 15:19:29 -05:00
Ms2ger
4f8b16592a servo: Merge #1850 - Don't initialize nullable interface arguments to None in codegen (from Ms2ger:init-interface); r=jdm
This allows Rust to check that we've actually initialized all cases.

Source-Repo: https://github.com/servo/servo
Source-Revision: 3a31372217516572a101ac707c70e8ec984bda72
2014-03-07 11:34:26 -05:00
Ms2ger
83e9cbca0c servo: Merge #1851 - Pass Option<JSVal> for optional JSVals (from Ms2ger:optional-jsval); r=jdm
Right now, we silently default to null, which is somewhat fishy.

Source-Repo: https://github.com/servo/servo
Source-Revision: 810699c47d52616b385dfc840ebca06d902f9233
2014-03-07 11:07:29 -05:00
Ms2ger
bfa13f1ef0 servo: Merge #1848 - Refactor the code that handles conversion of JSVals to primitive types (from Ms2ger:refactor-primitive-fromjsval); r=jdm
Probably best read commit-by-commit.

Source-Repo: https://github.com/servo/servo
Source-Revision: bdb551638ed260bccb9e51716a8bf0f759188f46
2014-03-07 10:01:36 -05:00
hgentry
383bccdf33 servo: Merge #1787 - Removed most glob imports from CodegenRust.py (from hgentry:mozilla-servo); r=jdm
Fixes #1779. Most of them were able to be replaced without issue.

Source-Repo: https://github.com/servo/servo
Source-Revision: 4a47145e6906df25a7dc2ec4f0992d2f2f4e8271
2014-03-06 23:55:30 -05:00
Ms2ger
92b26ad60b servo: Merge #1846 - Improve handling of non-null default values for optional nullable arguments (from Ms2ger:non-null-default); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 134d1f6fe33130470c5f32c6d1b178e2783e294c
2014-03-06 16:52:31 -05:00
Ms2ger
8a6b3d8aae servo: Merge #1829 - Remove page_from_context (from Ms2ger:page_from_context); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: b9b4eebab5664d026435d70bf3f2ac40c5b56826
2014-03-05 15:13:29 -05:00