Anthony Ramine
ec2a6b24b1
Support default values for restricted float members ( fixes #7217 )
2015-08-15 14:45:26 +02:00
bors-servo
2e1ca10eea
Auto merge of #7199 - frewsxcv:codegen-if-let, r=Manishearth
...
Prefer if..let over if..is_some..unwrap in codegen
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7199 )
<!-- Reviewable:end -->
2015-08-13 15:35:21 -06:00
Corey Farwell
43429abce4
Avoid marking codegen method bodies as unsafe twice
...
`CGAbstractMethod` takes a couple boolean parameters, among others:
* `extern`: will mark the method as `unsafe` and `extern`
* `unsafe`: will wrap the method body in an `unsafe` block
Passing both as `True` should not mark it as `unsafe` twice.
Example from a generated `HTMLCollectionBinding.rs`:
Before:
```
unsafe extern fn get_length(..) -> u8 {
unsafe {
// code here
}
}
```
After
```
unsafe extern fn get_length(..) -> u8 {
// code here
}
```
2015-08-13 16:50:17 -04:00
Corey Farwell
7a774a198c
Prefer if..let over if..is_some..unwrap in codegen
2015-08-13 16:35:21 -04:00
Corey Farwell
a276bfa57c
Remove dead Python code in binding generating code
...
Fixes #6956
2015-08-05 09:17:30 -04:00
Josh Matthews
8620fe5995
Start reporting memory usage for Window and all nodes in all DOM trees for frame treese in script tasks.
2015-08-03 23:05:00 -04:00
Ms2ger
e8cff1d2a2
Remove an obsolete comment I missed in #6804 .
2015-07-30 09:36:47 +02:00
Ms2ger
efa12e6963
Remove unrooted_must_root annotation from unions ( fixes #2661 ).
...
The unsafety was fixed as part of the SpiderMonkey upgrade; this removes the
now unused annotation.
2015-07-28 16:22:41 +02:00
Akos Kiss
fa86ea4f6f
Add aarch64-unknown-linux-gnu support
...
* Adding dependencies
* Replacing `i8` with `libc::c_char` to build properly on platforms
where char is unsigned.
2015-07-23 22:52:17 +00:00
snf
7f152b665d
Add Clamp and EnforceRange support for webidl arguments.
2015-07-22 17:04:06 +02:00
bors-servo
a9f12da4f8
Auto merge of #6592 - frewsxcv:notimplementederror, r=Ms2ger
...
Use NotImplementedError for Python base class methods
From the Python docs:
https://docs.python.org/2/library/exceptions.html#exceptions.NotImplementedError
"In user defined base classes, abstract methods should raise this
exception when they require derived classes to override the method."
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6592 )
<!-- Reviewable:end -->
2015-07-21 11:28:21 -06:00
Ms2ger
ce4d442941
Move away from the repeat().take().collect() pattern.
...
This was the preferred pattern between the deprecation of Vec::from_elem and
the addition of the count argument to the vec![] macro.
2015-07-14 16:19:30 +02:00
Corey Farwell
10296e77dc
Use NotImplementedError for Python base class methods
...
From the Python docs:
https://docs.python.org/2/library/exceptions.html#exceptions.NotImplementedError
"In user defined base classes, abstract methods should raise this
exception when they require derived classes to override the method."
2015-07-11 07:41:44 +09:00
Corey Farwell
0ec2375cab
Remove tidy blacklist for 'script/dom/bindings/*'
...
Recently, I found myself reading through the Python codegen scripts that
live in 'components/script/dom/bindings/*' and noticed that there were
many tidy violations: unnecessary semicolons, weird spacing, unused
variables, lack of license headers, etc. Considering these files are now
living in our tree and mostly maintained directly by contributors of
Servo (as opposed to being from upstream), I feel these files should not
be excluded from our normal tidy process. This commit removes the
blacklist on these files and fixes all tidy violations.
I added these subdirectories to the blacklist because they appear to be
maintained upstream somewhere else:
* "components/script/dom/bindings/codegen/parser/*",
* "components/script/dom/bindings/codegen/ply/*",
Also, I added a '# noqa' comment which tells us to ignore the
flake8 errors for that line. I chose to ignore this (instead of fixing
it) to make the work for this commit simpler for me.
2015-07-09 19:42:31 +09:00
Ms2ger
2f88b84e07
Remove *Cast::from_actual.
...
Since JSRef was removed, from_actual duplicates from_ref.
2015-07-04 12:55:01 +02:00
David Winslow
4cf46bff2d
Refactor #[jstraceable] to #[derive(JSTraceable)]
...
fixes #6524
2015-07-01 18:27:06 -04:00
Mukilan Thiyagarajan
8f5265c131
CGImports must consider special operations to generate required 'use' items
2015-06-27 19:01:17 +05:30
Ms2ger
932aa06694
Use Rc::get_mut rather than deprecated rc::get_mut.
2015-06-26 17:17:18 +02:00
Ms2ger
28086f3c75
Use Box::into_raw rather than boxed::into_raw.
...
The latter is deprecated.
2015-06-25 23:03:54 +02:00
Joel Teichroeb
012be81eab
Add support for NamedConstructor in webidls
2015-06-24 10:42:53 -07:00
Anthony Ramine
a90983553b
Merge generic funs to share them across all bindings ( fixes #2684 )
2015-06-24 11:34:30 +02:00
Michael Wu
675267b782
Upgrade to SM 39
2015-06-19 18:42:48 -04:00
Jack Moffitt
07d95627ca
Generate code into OUT_DIR.
...
This is necessary to ensure Cargo knows when to rebuild. Normally
.gitignore would be enough to exclude these from Cargo's freshness
calculation, but https://github.com/rust-lang/cargo/issues/1729 prevents
this currently. This is the new, correct way to do these thigns, just
like the style crate does.
2015-06-17 16:18:22 -06:00
Ms2ger
0607cd3fb5
Return Fallible from get_callable_property.
2015-06-14 20:08:06 +02:00
Mukilan Thiyagarajan
e5b8e81bf8
Fix codegen for overload resolution. Fixes #6300
2015-06-10 14:14:31 +05:30
bors-servo
ca6a34a1cd
Auto merge of #6299 - GreenRecycleBin:#6271, r=Ms2ger
...
get_proto_or_iface_array now returns *mut ProtoOrIfaceArray
Fix #6271
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6299 )
<!-- Reviewable:end -->
2015-06-07 10:47:14 -05:00
bors-servo
78665336e6
Auto merge of #6297 - brson:inline, r=jdm
...
This results in a 14% compile time improvement.
See https://gist.github.com/brson/b48dd03b06c406be68e6
I'm not suggesting you merge this as-is, but you might consider whether removing some of these is worth pursuing.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6297 )
<!-- Reviewable:end -->
2015-06-06 08:25:29 -05:00
Daniel Le
15c4f7fe2d
Avoid casting in the callers
...
get_proto_or_iface_array now returns *mut ProtoOrIfaceArray
Fix #6271
2015-06-06 12:22:18 +08:00
Brian Anderson
172fbcad27
Convert inline(always) to inline in CodegenRust and jstraceable.
...
This results in a 14% compile time improvement.
See https://gist.github.com/brson/b48dd03b06c406be68e6
2015-06-05 14:56:11 -07:00
Josh Matthews
453679fd1f
Trace the prototype array on the global object.
2015-06-01 18:36:57 -04:00
ecoal95
b3ac346749
Add WebGLContextAttributes support
...
This commit also:
* Allows to return non-rootable dictionaries from
Codegen.
* Merges the two context types in an enum type.
2015-06-01 15:29:38 +02:00
Philipp Hartwig
ab4059ca21
Use byte string instead of handcrafted byte array
2015-05-25 20:57:16 +02:00
Anthony Ramine
d9619853e2
Fix length value of interface methods
2015-05-14 19:11:10 +02:00
Anthony Ramine
cc5eee48a6
Generate forwarded setters
2015-05-07 16:04:25 +02:00
bors-servo
2c17779440
Auto merge of #5896 - nox:stringifier-proxy, r=jdm
...
The proxy stringifiers called through {}.toString.call() (obj_toString) shouldn't use the stringifier.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5896 )
<!-- Reviewable:end -->
2015-04-30 04:33:32 -05:00
Anthony Ramine
2a2e8b176d
Properly generate proxy stringifiers
2015-04-29 18:52:38 +02:00
Ms2ger
903305416a
Implement Clone for Copy types.
2015-04-28 23:31:10 +02:00
bors-servo
01925f0f8f
Auto merge of #5845 - snf:defineProperty_fix, r=jdm
...
This patch should get rid of #5223 .
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5845 )
<!-- Reviewable:end -->
2015-04-28 07:51:31 -05:00
Anthony Ramine
7197052c0d
Uniformise root() methods
...
They now live in traits Rootable, OptionalOptionalRootable, OptionalRootable
and ResultRootable.
2015-04-28 09:22:45 +02:00
Manish Goregaokar
dcb0a0eab6
Fix some no_move errors
2015-04-28 04:20:45 +05:30
snf
cdcd6670ba
fix defineproperty for cases with namedsetter
2015-04-27 23:47:22 +01:00
bors-servo
92359c7b9a
Auto merge of #5850 - nox:nullary-callbacks, r=jdm
...
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5850 )
<!-- Reviewable:end -->
2015-04-27 08:42:42 -05:00
Anthony Ramine
4e7b9d319c
Remove useless unsafe methods on LayoutJS<T>
2015-04-26 21:39:11 +02:00
Anthony Ramine
9369b616ce
Remove useless unsafe methods on JS<T>
2015-04-26 21:39:09 +02:00
Anthony Ramine
d4f809f95e
Fix generation of nullary callbacks
2015-04-26 16:49:43 +02:00
bors-servo
1f9de5ee2c
Auto merge of #5779 - nox:css-escape, r=Ms2ger
...
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5779 )
<!-- Reviewable:end -->
2015-04-25 05:42:41 -05:00
Anthony Ramine
7e7b421db9
Fix generation of static JS methods
...
They now take a global argument.
2015-04-25 12:23:39 +02:00
Ms2ger
4d41f1c991
Stop using the deprecated range function.
2015-04-22 20:26:40 +02:00
bors-servo
1f9c2f9b34
Auto merge of #3726 - ChrisParis:callback-constants, r=jdm
...
This addresses https://github.com/servo/servo/issues/3149 . The immediate purpose is to support the constants in NodeFilter. The changes mostly follow the current Gecko Codegen.py. The main gist is that the generation of certain code artifacts is now gated by hasInterfaceObject() or hasInterfacePrototypeObject(), rather than by isCallback().
2015-04-13 14:34:39 -05:00
Chris Paris
d2b0d5e040
Support callback interfaces with constants.
2015-04-11 09:34:44 -10:00