Commit graph

347 commits

Author SHA1 Message Date
Ms2ger
d8801da9c5 Move WebIDL unions into their own module.
This will allow multiple unions to contain the same type.
2014-06-03 18:47:59 +02:00
bors-servo
52a809259a auto merge of #2550 : Ms2ger/servo/default-handling, r=jdm 2014-06-02 18:01:22 -04:00
Ms2ger
97efd122a3 Rename BindingDeclarations to Bindings. 2014-06-02 19:48:42 +02:00
Ms2ger
dea8a4ffcb Support dictionary members without default values. 2014-06-02 19:37:06 +02:00
Ms2ger
ebd9b9a519 Rewrite the dictionary codegen to use pattern matching rather than is_some/unwrap. 2014-06-02 19:37:06 +02:00
Ms2ger
2a91e987b4 Return the default value from getJSToNativeConversionTemplate, to allow reusing it more easily.
This commit does not change the generated code.
2014-06-02 19:37:05 +02:00
Ms2ger
6d619f484c Support enumerations in dictionaries. 2014-06-02 14:46:23 +02:00
Ms2ger
33e64c95d3 Include modules with only callbacks in BindingDeclarations.
This commit also includes improvements to the 'use' order in some of the
touched files.
2014-05-31 18:58:04 +02:00
Ms2ger
0e83f5af00 Fix minor misformatting in codegen. 2014-05-30 21:49:09 +02:00
bors-servo
da896b8299 auto merge of #2515 : saneyuki/servo/raw, r=jdm
Fix #2511

@jdm r?
2014-05-30 13:16:09 -04:00
Ms2ger
b448972d52 Throw DOMExceptions where appropriate (fixes #2518). 2014-05-30 18:14:02 +02:00
Tetsuharu OHZEKI
106627e6eb "JS<T>::from_raw" should accept "*T" instead of "*mut T" 2014-05-31 01:10:19 +09:00
Josh Matthews
003e5bcd46 Port modern callback handling code from Gecko, and copy related WebIDL parser bits too. 2014-05-27 20:43:52 +02:00
Josh Matthews
2d6153772c Add stubs for inline event handler manipulation. 2014-05-27 20:43:48 +02:00
Ms2ger
51d2891c9b Make GetProtoOrIfaceArray return the actual type. 2014-05-26 20:19:38 +02:00
Ms2ger
1834855ff5 Pass an immutable pointer to the private in NewProxyObject. 2014-05-26 20:18:00 +02:00
Ms2ger
d5cb4377ef Use *mut T for the T* pointers in SpiderMonkey. 2014-05-26 18:19:44 +02:00
Ms2ger
eaedeb07cb Update Rust. 2014-05-22 16:36:40 -06:00
bors-servo
58283527bf auto merge of #2452 : Ms2ger/servo/getDefaultRetval, r=jdm 2014-05-16 10:25:51 -04:00
Ms2ger
fcd98e1c0d Stop returning a default return value from getRetvalInfo.
This is now unused.
2014-05-16 12:10:57 +02:00
Ms2ger
7abbef8919 Remove getDefaultRetval.
getDefaultRetval was supposed to be used after throwing an exception on the
ErrorResult outparam in C++. However, as we throw exceptions through the
return value in Servo, we don't need it at all.
2014-05-16 12:00:59 +02:00
Glenn Watson
7cba2f1738 Remove unused imports for UnionTypes codegen. Fixes #2440. 2014-05-16 08:46:20 +10:00
Ms2ger
30fcf7ed61 Remove the isOptional argument and the dealWithOptional return value from getJSToNativeConversionTemplate.
Note that dictionaries currently don't support members without default values
right now.

This commit does not change the generated code.
2014-05-10 11:00:01 +02:00
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
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