Commit graph

431 commits

Author SHA1 Message Date
Jack Moffitt
c6ab60dbfc Cargoify servo 2014-09-08 20:21:42 -06:00
Pierre Louis Aublin
cf734b01b7 Throw TypeErrors instead of uncatcheable exceptions in CodegenRust.py (fixes #347, #3065). 2014-09-04 14:45:24 +02:00
Chris Paris
b2b3fbc6e0 Support callback return types in codegen 2014-08-28 17:03:34 -10:00
Ms2ger
cadc84319a Introduce the NativePropertyHooks struct.
This will be required for the cross-origin wrapper work.
2014-08-28 11:39:02 +02:00
Ms2ger
16510963b5 Update ProxyTraps to use real bools. 2014-08-26 14:50:30 +02:00
Ms2ger
ca33790357 Merge pull request #3121 from Ms2ger/sorted-dictionaries
Stop resorting dictionaries; r=abinader
2014-08-20 18:33:09 +02:00
Ms2ger
44bba09035 Use extended attributes to define which interfaces are globals (fixes #1053).
This makes our approach consistent with Gecko's.
2014-08-20 11:55:13 +02:00
Ms2ger
863e46dabe Stop resorting dictionaries.
Rust is more forgiving about the order of definitions than C++, so there is no
need to try to sort them. Worse, the "sorting" actually causes the order in
the generated file to be non-deterministic.
2014-08-20 11:48:57 +02:00
Ms2ger
ef357bbbb0 Add a documentation comment for CGWrapMethod. 2014-08-19 16:10:47 +02:00
Ms2ger
ea3c2c243c Replace hasInterfacePrototypeObject checks by isCallback checks in codegen.
Checking for callbacks directly makes it a lot clearer what's going on, and we
don't intend to take hasConcreteDescendant into consideration.

See also <https://bugzilla.mozilla.org/show_bug.cgi?id=1026720>.
2014-08-19 10:38:34 +02:00
Jack Moffitt
7a4321d649 Upgrade Rust. 2014-08-08 19:11:53 -06:00
Ms2ger
98d25e3de9 Correct the fallibility of proxy operations in the *Methods trait (fixes #3041).
A typo caused us to use the fallibility of the last normal method in the
interface.
2014-08-08 10:28:44 +02:00
Ms2ger
be7ef50f27 Throw a TypeError when unwrapping a this object fails. 2014-08-05 16:23:02 +02:00
Ms2ger
715ae6ab55 Throw a TypeError when unwrapping an interface argument fails. 2014-08-05 16:23:02 +02:00
Ms2ger
7f707020be Remove FailureFatalCastableObjectUnwrapper.
The inheritance pattern used here was not particularly enlightening, and only
one caller uses FailureFatalCastableObjectUnwrapper.
2014-08-05 16:23:02 +02:00
Ms2ger
db3078fde4 Fix the double indentation in CastableObjectUnwrapper.
The current code indents the first line of codeOnFailure four spaces too far.
2014-08-05 16:23:01 +02:00
Jack Moffitt
b91e6f30e0 Upgrade Rust. 2014-08-02 21:11:47 -06:00
Ms2ger
83cc23089a Throw a TypeError when a non-object is passed where one is expected. 2014-07-30 21:45:55 +02:00
Sankha Narayan Guria
6b44f92c4f Implement the delete proxy trap (fixes #2213). 2014-07-29 13:26:02 +02:00
Ms2ger
944d8b00b0 Call the generated rather than the hand-written traits (fixes #2936). 2014-07-27 23:00:17 +02:00
Ms2ger
38a658d561 Generate traits for the generated bindings code to call. 2014-07-27 22:59:46 +02:00
Ms2ger
3a68b9dbf2 Remove an unused argument to needCx and use it in CGCallGenerator. 2014-07-27 22:54:51 +02:00
Ms2ger
e34bcaaa5f Pass a non-nullable string to NamedGetter.
There is no actual reason to use a nullable string here; all callers have a
string they want to pass.

The issue dates back to the time that DOMString was inherently nullable
(before #1215); this API was not converted back to the non-nullable DOMString
type after that landed.
2014-07-27 22:54:01 +02:00
Ms2ger
829259fb79 Introduce abstractions for global scopes.
Part of #2811.
2014-07-15 15:33:57 +02:00
Ms2ger
a51ed7045c Remove the unused 'obj' local from the construct hook. 2014-07-14 11:42:42 +02:00
Ms2ger
ac5a2767bf Move the call to RegisterBindings::Register into WindowBinding::Wrap. 2014-07-13 15:45:16 +02:00
Ms2ger
5baff0cc2c Pass a JSContext and a reflector to RegisterBindings::Register.
This makes the generated code less dependent on the fact that all global
objects are Windows.
2014-07-13 15:45:16 +02:00
Ms2ger
fd167f8922 Store proxy handlers in a static array rather than a hashtable per window. 2014-07-12 15:26:36 +02:00
Josh Matthews
f47b66b0c1 Merge pull request #2807 from Ms2ger/pyflakes-2
Remove some dead code and fix some pyflakes warnings in CodegenRust.py.
2014-07-11 20:48:41 -04:00
Ms2ger
a867e4bd52 Remove some dead code and fix some pyflakes warnings in CodegenRust.py. 2014-07-11 14:51:43 +02:00
Ms2ger
439bc78cab Return a Temporary from *Binding::Wrap.
Returning a JS<T> is GC-unsafe.

This commit also includes some cleanup around Node and Document reflection.
2014-07-10 16:45:41 +02:00
Manish Goregaokar
7cc8e2eb57 Remove deref_mut from Untraceable/Traceable (fixes #2736) 2014-07-01 00:59:52 +05:30
Manish Goregaokar
f5b5b337d3 Upgrade to latest Rust. 2014-06-27 18:50:32 -06:00
Ms2ger
696c57006b Store this-values and arguments in immutable locals in codegen. 2014-06-22 17:17:27 +02:00
Ms2ger
4f0d6979e7 Implement static attributes (fixes #1989). 2014-06-22 15:15:18 +02:00
Ms2ger
6d2784aece Implement static methods (fixes #1989). 2014-06-22 15:15:12 +02:00
Ms2ger
92f9fe59e5 Introduce static makeNativeName methods to share code with the upcoming static members. 2014-06-22 15:10:56 +02:00
Ms2ger
4964d2792e Pass the NativeProperties struct to CreateInterfaceObjects2.
This will simplify adding more kinds of properties, such as static attributes.
2014-06-22 13:25:18 +02:00
Ms2ger
886d401ff0 Introduce a NativeProperties struct to store the properties.
This will simplify adding more kinds of properties, such as static attributes.
2014-06-22 13:25:18 +02:00
Ms2ger
da28a791e5 Store the arrays of properties as &'static [T] rather than [T, ..N].
This means the .as_slice() call (which is problematic when storing the array
in a static struct) is no longer necessary.
2014-06-22 13:25:18 +02:00
Ms2ger
0731045249 Remove some spurious newlines from the generated code. 2014-06-21 20:07:09 +02:00
Ms2ger
5fb475617b Move the responsibility for indenting code from CGAbstractMethod.definition_body to its caller. 2014-06-21 14:48:23 +02:00
Ms2ger
46b9343459 Use CGIndenter for CGRegisterProtos.definition_body. 2014-06-21 14:44:08 +02:00
Ms2ger
f3a8f74d3c Use CGIndenter for CGClassConstructHook.definition_body. 2014-06-21 14:38:58 +02:00
Ms2ger
31ab6415c9 Use CGIndenter for CGAbstractClassHook.definition_body. 2014-06-21 14:36:35 +02:00
Ms2ger
504efb66fb Indent the contents of obj_toString correctly. 2014-06-21 14:25:08 +02:00
Ms2ger
eb4213f613 Indent the contents of get. 2014-06-21 14:22:14 +02:00
Ms2ger
b5ca6d9a37 Indent the contents of hasOwn. 2014-06-21 14:19:31 +02:00
Ms2ger
cf556cbbd6 Indent the contents of defineProperty. 2014-06-21 14:14:49 +02:00
Ms2ger
8ef51158ff Indent the contents of getOwnPropertyDescriptor. 2014-06-21 14:10:14 +02:00