Ms2ger
65ed97bab8
Introduce a get_dictionary_property function to reduce duplicated code in 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.
2014-04-18 20:10:55 +02:00
Ms2ger
88c5e733b5
Merge the 'new' and 'Init' functions for dictionaries.
...
This moves the code in callers more in line with conversions for other types
and ensures the default values given to the dictionary fields (as defined by
the defaultValue function in CGDictionary.impl) do not escape the 'new'
method. The new code is also more in line with the code used by the
FromJSValConvertible trait.
This is the first step of my planned rewrite of the dictionary initialization
that will remove the default values entirely and reduce the code
duplication in the 'Init' (now 'new') function.
2014-04-18 17:12:20 +02:00
Ms2ger
8e596d142e
Use 'exceptionCode' when converting to DOMString.
...
This change allows us to use the code even in cases where we return a
Result type rather than a JSBool. Interface, primitive and union types
already get this right.
2014-04-18 17:12:20 +02:00
bors-servo
58efe0bf75
auto merge of #2156 : Ms2ger/servo/codegen-deadcode, r=jdm
2014-04-18 10:28:11 -04:00
Ms2ger
857eb87bb6
Remove unused references to jsids in the generated code for dictionaries.
2014-04-18 15:52:40 +02:00
Ms2ger
9d7478ab8a
Remove some dead code from codegen as found by pyflakes.
2014-04-18 15:52:40 +02:00
bors-servo
099815683d
auto merge of #2155 : Ms2ger/servo/dictionary-codegen, r=jdm
2014-04-18 09:40:11 -04:00
Ms2ger
5ac5ba2468
Support nullable strings in dictionaries.
...
We copy the string in all cases, so there's no need to handle the isMember
case differently.
2014-04-18 11:37:56 +02:00
Ms2ger
4d20d1716d
Implement support for default values for enumeration arguments.
2014-04-18 11:08:21 +02:00
Ms2ger
d53841b016
Handle exceptions from FindEnumStringIndex correctly.
...
The previous code would return success from the JSNative with a pending
exception, potentially leading to assertion failures inside the JS engine
later.
2014-04-18 10:18:24 +02:00
Ms2ger
baa3845362
Rewrite FindEnumStringIndex to distinguish 'value not found' and 'exception raised'.
...
This is in preparation for handling those cases differently.
2014-04-18 10:18:17 +02:00
Josh Matthews
742f73ded5
Add transparent Traceable and Untraceable types to aid proper rooting practices, and replace ad-hoc Untraceable structs with empty Encodable implementations.
2014-04-17 17:41:09 -04:00
Ms2ger
c9c96d4758
Ensure that optional primitive arguments aren't treated as nullable.
...
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.
2014-04-17 16:23:09 +02:00
Ms2ger
f77b775e62
Remove unwrap_object.
...
There is no good reason to have both unwrap_object and unwrap_jsmanaged.
Removing unwrap_object simplifies the codegen and makes further
simplifications easier.
2014-04-16 11:54:46 +02:00
bors-servo
7149a25e91
auto merge of #2112 : Ms2ger/servo/IDLInterface-JS, r=jdm
2014-04-16 04:22:11 -04:00
Ms2ger
ac46cc6047
Implement FromJSValConvertible for JS<T>.
2014-04-15 21:33:18 +02:00
bors-servo
038730c4bb
auto merge of #2054 : sankha93/servo/imageattr, r=jdm
2014-04-15 12:49:14 -04:00
bors-servo
e4f33eb9b9
auto merge of #2114 : Ms2ger/servo/unused-obj-local-arg, r=jdm
...
This removes the local variable and prefixes the argument with an underscore.
Neither is used right now.
2014-04-15 12:22:44 -04:00
Ms2ger
e4305fe20e
Remove unused variable 'obj' from binding functions.
...
This removes the local variable and prefixes the argument with an underscore.
Neither is used right now.
2014-04-15 17:37:54 +02:00
Ms2ger
dc11464933
Remove the return value from DefineDOMInterface.
...
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.
2014-04-15 17:32:10 +02:00
bors-servo
0c4354a439
auto merge of #2093 : Ms2ger/servo/DOMObjectPointerType, r=jdm
2014-04-10 15:16:17 -04:00
Ms2ger
493227c938
Remove DOMObjectPointerType.
2014-04-10 20:19:32 +02:00
Ms2ger
d11316fa05
Make GetCallableProperty more rustic.
2014-04-10 19:21:17 +02:00
Ms2ger
6c32a7f05f
Remove getWrapTemplateForType and simplify wrapForType.
2014-04-10 13:08:54 +02:00
Ms2ger
8c4a3aa387
Use ToJSValConvertible for all conversions to JSVal.
2014-04-10 12:09:18 +02:00
Josh Matthews
b87d351fee
Remove all traces of C wrappers for SpiderMonkey class stubs.
2014-04-08 10:15:12 -04:00
Sankha Narayan Guria
58e5feca9f
HTMLImageElement attribute getters and setters
2014-04-08 08:44:38 +05:30
bors-servo
7541b57526
auto merge of #2051 : Ms2ger/servo/more-xray, r=jdm
...
On top of #2050
2014-04-07 13:01:16 -04:00
Daniel Glazman
4b0da08573
Implement Document.createElementNS.
2014-04-07 10:20:10 +02:00
Ms2ger
2e2a39b8d5
Remove some more xray code.
2014-04-06 23:08:54 +02:00
bors-servo
86c83f7bfc
auto merge of #2050 : sankha93/servo/rmxray, r=Ms2ger
2014-04-06 17:04:26 -04:00
Sankha Narayan Guria
9a4bec304f
Remove XRay related stuff from codegen ( fixes #1936 )
2014-04-07 02:27:53 +05:30
Ms2ger
a52cffebeb
Use ToJSValConvertible to convert nullable enums to JSVal.
2014-04-06 19:51:12 +02:00
Ms2ger
ccaa46e4a3
Use ToJSValConvertible to convert enums to JSVal.
2014-04-06 19:42:39 +02:00
Ms2ger
9a909229e3
Remove EnumEntry, as Rust already provides O(1) access to the string length.
2014-04-06 19:16:24 +02:00
Ms2ger
3e0d4a2509
Move all the generated code for enums into CGEnum.
2014-04-06 19:06:58 +02:00
bors-servo
ef5567b585
auto merge of #1994 : hyunjunekim/servo/try, r=jdm
...
#1991
2014-04-04 20:01:47 -04:00
Ms2ger
31eee791dd
Upgrade rust.
2014-04-04 20:10:32 +02:00
hyunjunekim
a344d465e8
documnet location
2014-04-04 21:18:30 +09:00
Bruno de Oliveira Abinader
990545c310
Implemented Node.adoptNode
...
Spec:
http://dom.spec.whatwg.org/#dom-document-adoptnode
2014-03-26 09:49:07 -04:00
Bruno de Oliveira Abinader
8a457a2caa
Implemented Document.importNode
...
Spec:
http://dom.spec.whatwg.org/#dom-document-importnode
2014-03-26 09:49:07 -04:00
Huon Wilson
94e4ab3eaf
Remove some unnecessary transmutes.
...
These can either be done by implicit `&` -> `*` coercions, explicit `*`
-> `*` casts, or an explicit `&*x` `*` -> `&` re-borrow (which is still
unsafe, but significantly more controlled compared to a `transmute`).
2014-03-25 22:23:55 +11:00
bors-servo
3401a568f2
auto merge of #1966 : lpy/servo/issue1955, r=jdm
...
see #1955
2014-03-23 13:25:42 -04:00
Tetsuharu OHZEKI
cfb2af60d8
Annotate 'inline' to TCast::to/to_unchecked/from.
2014-03-23 23:12:12 +09:00
lpy
f6d912a94f
Remove |unused| field from DOMClass.( fixes #1960 )
2014-03-22 15:17:44 +08:00
lpy
2fe92bf7ba
Make JS<T>::clone inline.( fixes #1955 )
2014-03-22 14:57:55 +08:00
bors-servo
54da52fa77
auto merge of #1950 : Ms2ger/servo/nullable-string-with-null-default, r=jdm
2014-03-21 06:49:34 -04:00
Ms2ger
6ee2e29e62
Make unwrap and unwrap_object less generic.
2014-03-20 23:26:22 +01:00
Ms2ger
a4fc6961a8
Remove support for non-castable arguments.
2014-03-20 23:17:46 +01:00
Ms2ger
acffed2dcd
Fix code generation for a null default value for nullable string arguments.
2014-03-20 22:51:31 +01:00