Commit graph

441 commits

Author SHA1 Message Date
Ms2ger
6ed924f515 Remove the argcAndIndex argument from instantiateJSToNativeConversionTemplate.
This commit does not change the generated code.
2014-05-10 10:50:10 +02:00
Cameron Zwarich
20fa4d7e11 Remove an unused field from CodegenRust.py.
The defaultVisibility field was cloned from the C++ implementation,
where it tracks the difference between struct and class visibility.
Since no similar concept exists in Rust, it should be removed.
2014-05-08 13:59:53 -07:00
Manish Goregaokar
2f376a1104 Add ProgressEvent interface 2014-05-08 20:41:51 +05:30
bors-servo
86a6de209e auto merge of #2346 : gsingh93/servo/master, r=jdm 2014-05-07 18:58:18 -04:00
Gulshan Singh
fb0c433b70 Add Performance object to Window and implement Performance::Now() 2014-05-07 17:30:33 -04:00
Ms2ger
0ab3444af9 Add support for DOMString in unions (fixes #2324). 2014-05-07 17:30:32 -04:00
Ms2ger
87008a5ae1 Remove unused zip_copies. 2014-05-07 12:29:26 +02:00
Glenn Watson
51ef2f06ba Rename from_unrooted to from_temporary. Fixes #2332. 2014-05-07 09:25:32 +10:00
bors-servo
8d1b9db5aa auto merge of #2343 : Ms2ger/servo/String-union, r=jdm 2014-05-06 10:25:23 -04:00
Ms2ger
590a8ac824 Add support for DOMString in unions (fixes #2324). 2014-05-06 15:51:17 +02:00
Ms2ger
8ea3cbf18a Enter a compartment when calling callbacks. 2014-05-06 12:16:03 +02:00
Ms2ger
0016b1839e Use a single JSContext per JSRuntime.
The long-term plan for SpiderMonkey is to eliminate JSContexts by merging
(most of) it into JSRuntime, so to future-proof our code, we should avoid
creating multiple JSContexts for the same JSRuntime.

However, this implies we'll have to use the same JSContext for objects in
different compartments, so we need to enter compartments. This is done by
using the with_compartment function.
2014-05-05 19:41:02 +02:00
Ms2ger
262dc30c18 Assign into the argument binding directly in instantiateJSToNativeConversionTemplate. 2014-05-05 11:36:52 +02:00
Ms2ger
aed95dfd94 Move the assignment outside the if when dealing with optional arguments. 2014-05-05 11:36:52 +02:00
Ms2ger
d14efebb5c Move the assignment of 'None' in the no-argument-passed case into an else branch.
This is the only case where we assign into an argument local twice, so removing
it will allow us to make that binding immutable.
2014-05-05 11:36:52 +02:00
Ms2ger
cb2723c4ed Remove getJSToNativeConversionTemplate's initialValue return value.
This commit does not change the generated code.
2014-05-05 11:36:49 +02:00
Ms2ger
455465f3c6 Move the handling of default values in getJSToNativeConversionTemplate into handleOptional.
This is a first step towards moving responsibility for default values into the
caller, which should improve their code (in particular for the dictionary
codegen.

This also introduces a Dictionary::empty function, whose implementation is a
hack. The implementation will be improved once its codegen has access to the
raw default values.

Besides dictionaries, this commit does not change the generated code.
2014-05-05 11:29:46 +02:00
Ms2ger
e53c768b9e Use CGIfWrapper in instantiateJSToNativeConversionTemplate. 2014-05-05 11:21:13 +02:00
Ms2ger
2db1ce72f0 Remove references to unused substitution variables in getJSToNativeConversionTemplate. 2014-05-05 11:21:13 +02:00
Glenn Watson
71f3f5894e Prevent unused result warning in codegen. Always expect success for now. 2014-05-05 11:04:05 +10:00
Josh Matthews
91278da9dd Address review comments. 2014-05-03 14:18:31 -04:00
Josh Matthews
895e9ee37f Make dictionaries contain Root<T> values instead of JS<T>, ensuring that they will not be collected while the dictionary is alive. 2014-05-03 14:18:31 -04:00
Josh Matthews
0f2d0b1dc3 Address review comments. 2014-05-03 14:18:31 -04:00
Josh Matthews
7b3e6d1f21 Remove all root collections. 2014-05-03 14:18:31 -04:00
Josh Matthews
522d3f167b s/Unrooted/Temporary/g 2014-05-03 14:18:31 -04:00
Josh Matthews
7daa97c7e5 Remove abstract_self. 2014-05-03 14:18:30 -04:00
Josh Matthews
76783b029e Move WebIDL methods to traits implemented by JSRef types. 2014-05-03 14:18:30 -04:00
Josh Matthews
dfdda0098a Remove JS::get/get_mut to enforce sound rooting practices. 2014-05-03 14:18:30 -04:00
Josh Matthews
d7b96db33c Implement safe rooting strategy via Unrooted, Root, JSRef, and JS. 2014-05-03 14:18:30 -04:00
Josh Matthews
ffdc3f5b32 Turn on GC all the time. Fix rooting errors during parsing and storing timers. Fix borrow errors during tracing. 2014-05-03 14:18:30 -04:00
bors-servo
812d70942f auto merge of #2295 : Ms2ger/servo/JSCLASS_DOM_GLOBAL, r=jdm
It seems unlikely that this will ever be hit, but potentially hard to
figure out if it ever is hit.
2014-05-03 05:37:15 -04:00
Ms2ger
599d76fa6e Add JSCLASS_DOM_GLOBAL to DOM global classes, and assert it is used.
It seems unlikely that this will ever be hit, but potentially hard to
figure out if it ever is hit.
2014-05-03 10:37:46 +02:00
Manish Goregaokar
619da07a4f Webidl and basic implementation of XHR object 2014-05-03 14:00:20 +05:30
bors-servo
b36b779d24 auto merge of #2290 : saneyuki/servo/export, r=jdm
- Fix #2128
- Take over from #2220

I didn't change `InterfaceTypes.rs` to `type.rs` because `type` is very common name which might be troublesome.
2014-05-01 23:34:39 -04:00
Ms2ger
8c879c8bf8 Implement WebIDL codegen for ByteString. 2014-05-01 22:02:53 +02:00
Ms2ger
541d581c32 Change some isString() checks in the WebIDL codegen to isDOMString() checks. 2014-05-01 21:11:12 +02:00
Ms2ger
05150f82e1 Add missing ByteString support in the WebIDL parser. 2014-05-01 20:58:17 +02:00
Ms2ger
0df5d95eb3 Change some isString() checks in the WebIDL parser to isDOMString() checks. 2014-05-01 20:56:10 +02:00
Tetsuharu OHZEKI
78856c87a4 Remove the 'pub use self::BindingDeclarations::*;' export. 2014-05-01 18:49:16 +09:00
Ms2ger
844d48e0af Merge UnionConversions() into UnionTypes().
It's not very useful to have one but not the other, so it makes more sense
to deal with them together.
2014-04-29 21:33:27 +02:00
Ms2ger
c51879767e Reuse getTypes in UnionConversions().
This should be equivalent, except that the removed code ignores return
values (which we currently don't support).
2014-04-29 21:18:56 +02:00
Ms2ger
19166b2f53 Remove C++-specific union codegen code. 2014-04-29 21:17:52 +02:00
bors-servo
0bfbe06f4b auto merge of #2194 : Ms2ger/servo/typeerror-2, r=jdm 2014-04-28 13:19:36 -04:00
Ms2ger
505e7d472a Use more rustic names for ThrowTypeError and infrastructure. 2014-04-28 17:18:28 +02:00
Ms2ger
7ff9fff421 Move ThrowTypeError to error.rs. 2014-04-28 16:50:53 +02:00
bors-servo
32bceb3ae7 auto merge of #2244 : Ms2ger/servo/optional-rewrite, r=jdm
This moves all handling of `isOptional` (except `type.isCallback()`, which I believe @jdm is rewriting in #2204) into one place.
2014-04-28 10:46:46 -04:00
Ms2ger
bfde816da0 Throw a TypeError when too few arguments are passed. 2014-04-28 11:29:46 +02:00
Ms2ger
095ed61c94 Use handleOptional for callback interface conversion. 2014-04-28 10:44:11 +02:00
Ms2ger
08fce9a321 Use handleOptional for dictionary conversion.
This does not have any effect, as isOptional is always False for dictionaries.
This change is made only for consistency.
2014-04-28 10:38:44 +02:00
bors-servo
9f742a9462 auto merge of #2237 : Ms2ger/servo/union-fromjsvalconvertible, r=jdm
With bonus codegen tests.
2014-04-28 04:01:36 -04:00