Commit graph

165 commits

Author SHA1 Message Date
Anthony Ramine
445701d138 Update js, AGAIN 2016-11-27 12:19:19 +01:00
Ms2ger
e367822b3e Update js. 2016-11-27 12:19:19 +01:00
Hugo Thiessard
4654dd91a8 Issue #13377 Extract panic-catching for JS engine callbacks into a
separate function
2016-09-26 19:20:22 +02:00
Tetsuharu OHZEKI
0277cf9174 Make DOMJSClass use JSClass instead of Class (fixes #13031) 2016-08-26 22:31:09 +02:00
Anthony Ramine
6c1167b1e2 Pass the receiver to get_property_on_prototype (fixes #11600) 2016-08-25 15:48:07 +02:00
Anthony Ramine
f70fa98954 Make has_property_on_prototype fallible 2016-08-25 15:46:43 +02:00
Anthony Ramine
fbc8938bee Mark get_property_on_prototype and has_property_on_prototype as unsafe 2016-08-25 15:46:42 +02:00
Anthony Ramine
a4f2159e36 Rename utils::create_dom_object to interface::create_global_object 2016-08-25 14:03:07 +02:00
Ms2ger
d678b20616 Implement the [Exposed] extended attribute on interfaces.
Fixes #2823.
2016-07-12 13:06:56 +02:00
Eduard Burtescu
0db1faf876 Switch to using the new rooted!/RootedGuard API for rooting. 2016-07-04 20:59:01 +03:00
bors-servo
2f9796fa69 Auto merge of #11329 - c-rhodes:11320, r=jdm
Report use statements that use {} with only one entry

Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data:
- [X ] `./mach build -d` does not report any errors
- [X ] `./mach test-tidy --faster` does not report any errors
- [X ] These changes fix #11320  (github issue number if applicable).

Either:
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11329)
<!-- Reviewable:end -->
2016-05-27 07:11:17 -05:00
Cullen Rhodes
40acd24e8f Report use statements that use {} with only one entry 2016-05-27 10:18:44 +01:00
Anthony Ramine
fd7c4f8149 Remove utils::Prefable in favour of guard::Guard 2016-05-26 23:56:13 +02:00
Anthony Ramine
a20db08f06 Remove Prefable::terminator 🤖 2016-05-26 23:55:37 +02:00
Anthony Ramine
cdc7bca944 Move DOMString back to script
This entirely removes the 'non-geckolib' feature of the util crate.
2016-05-24 10:54:57 +02:00
Emilio Cobos Álvarez
91101f6226
codegen: Throw a more descriptive invalid enum message 2016-05-13 11:44:39 +02:00
bors-servo
2c69278067 Auto merge of #10756 - servo:smup, r=Ms2ger
Update SpiderMonkey

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10756)
<!-- Reviewable:end -->
2016-05-03 15:46:40 -07:00
Anthony Ramine
eb94f1a918 Update SpiderMonkey 2016-05-03 18:36:11 +02:00
Josh Matthews
cb5bad63dc Implement hiding of interface members via Pref annotations. 2016-05-02 14:32:56 -04:00
Josh Matthews
88059acd7e Start generating arrays of specs for easier implementation of preference checks. 2016-05-02 14:32:55 -04:00
Anthony Ramine
4c2ca7a8c9 Refactor the call hook on non-callback interface objects (fixes #10744)
It's now set through the intermediate InterfaceConstructorBehavior structure,
which lets us improve the abstraction around NonCallbackInterfaceObjectClass
a bit better.

When the interface's constructor is supposed to always throw, the error for
calling `Foo()` without new is "Illegal constructor.". when the interface
actually defines an interface, the error is instead
"This constructor needs to be called with `new`.".
2016-04-25 11:44:59 +02:00
Anthony Ramine
1559f5a39f Lazily define interface objects on globals (fixes #6419) 2016-02-25 15:56:47 +01:00
Anthony Ramine
2c4d5da866 Lazily-define standard ECMAScript classes 2016-02-25 15:15:44 +01:00
Ms2ger
0e35931152 Stop returning an Option from Window::browsing_context.
A Window always has a WindowProxy; the only reason it's wrapped in a nullable
field is the order in which those objects are created.
2016-02-23 16:08:28 +01:00
Anthony Ramine
55dcee94be Bump heapsize to 0.3 2016-02-13 11:13:19 +01:00
Anthony Ramine
cb5cd8d881 Say farewell to in-tree HeapSizeOf 2016-02-04 22:03:32 +01:00
nxnfufunezn
e54929b4d7 Move ConstantSpec, NonNullJSNative and define_constants from utils to interface 2016-01-24 20:37:30 +05:30
Anthony Ramine
d13da7d9b3 Fix prototypes of interface objects (fixes #2665) 2016-01-12 17:15:44 +01:00
Anthony Ramine
833e0d2fac Refactor prototype initialisation
The function do_create_interface_objects is removed in favour of 4 functions:
create_callback_interface_object, create_interface_prototype_object,
create_noncallback_interface_object and create_named_constructors.

While this increases the amount of codegen'd code, this greatly improves the
readability of the code involved in this part of DOM, instead of having one function
doing 4 different things. We can always find a more adequate abstraction later.

NativeProperties and everything related to the interface objects have been removed
from the utils module.
2016-01-12 12:34:18 +01:00
Anthony Ramine
967948be06 Remove NativePropertyHooks 2016-01-12 12:34:18 +01:00
Bobby Holley
dec296ddbc Use features to prevent the util component from entraining the world in GeckoLib builds. 2016-01-11 19:38:43 -08:00
Ms2ger
b7b5c79787 Rename the browsercontext module. 2015-12-11 15:27:27 -05:00
Ms2ger
b353d70f44 Initialize the slots of global objects before a possible GC. 2015-12-10 12:08:42 -05:00
Anthony Ramine
60976406cc Implement [Unforgeable]
This is mostly stolen from Gecko. As there, we define the unforgeable members
on an object stored in the slots of the prototype object. They are then copied
onto instance objects when they are instantiated. It should be noted that
proxy objects see their unforgeable memebers defined on their expando object.

Unforgeable attributes aren't properly inherited in codegen (in a similar
fashion as getters and setters as filed in #5875) and require to be redefined
in derived interfaces. Fortunately, there are currently no such interfaces.

No unforgeable members can be included into the TestBinding interfaces for good
measure because they are not compatible with setters.

Given the unforgeable holder object has the same prototype as actual instances
of the interface, the finalize hook needs to check its slot pointer for nullity
before dropping it.

The new failing test isn't related to Unforgeable attributes, but to the fact
that all Document instances currently have a Location, even if their window
isn't in a browsing context.
2015-12-02 22:15:11 +01:00
Anthony Ramine
7547bcac24 Remove unused slot in prototype object (fixes #8588) 2015-11-30 14:48:24 +01:00
Brandon Fairchild
341e66f66d Remove #[allow(raw_pointer_derive)] attributes
The attributes are unused.

Fixes #8699.
2015-11-27 14:32:57 -05:00
Ms2ger
b7117893af Rename a confusing argument. 2015-11-19 16:18:28 +01:00
Ms2ger
0c61be7a57 Rustfmt some of script. 2015-11-18 11:14:05 +01:00
Ms2ger
6d2ae85c1f Use the conversion traits from js. 2015-11-12 10:48:58 +01:00
Ms2ger
acb24e80b8 Use throw_type_error and throw_range_error from js. 2015-11-12 10:20:19 +01:00
Anthony Ramine
b290a3161d Clean up the conversion routines
Functions returning `Root<T>` are prefixed by "root_" and the ones returning
`*const T` by "native_".

Functions taking `*mut JSObject` are now suffixed by "_from_object" and the ones
taking `&T` by "_from_reflector".
2015-11-11 14:19:30 +01:00
Ms2ger
6b75078503 Make DOMString a newtype around String, rather than a typedef.
This should make it somewhat easier to experiment with alternative
representations in the future. To reduce churn, this commit leaves the String
field public, though.

Also, this will allow us to use the default String type to represent the IDL
USVString type, which explicitly forbids unpaired surrogates, ans as such is
a better match to the Rust String type.
2015-11-04 12:09:11 +01:00
rohan.prinja
7032a5d1de more cleanup 2015-10-30 22:57:59 +09:00
rohan.prinja
51df8e310b rearrange imports to be in alphabetical order 2015-10-30 20:28:59 +09:00
rohan.prinja
9fd823e449 replace InheritTypes imports with inheritance imports 2015-10-30 20:26:30 +09:00
rohan.prinja
45224028db more refactoring 2015-10-30 20:26:29 +09:00
bors-servo
30ce2a84c1 Auto merge of #8242 - Ms2ger:update-js, r=metajack
Update js.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8242)
<!-- Reviewable:end -->
2015-10-28 23:35:40 +05:30
Ms2ger
2a2ab23dfb Update js. 2015-10-28 18:02:10 +01:00
Nathan Froyd
c82b6ce843 move reserved slot setting for DOM globals
Moving this slot setting prior to initializing standard classes and
other initialization tasks means that we can effectively use JS_GC_ZEAL.

Fixes #6057.
2015-10-27 18:08:35 -04:00
Ms2ger
54d3462fa5 Use the new define_methods and define_properties functions from js. 2015-10-25 19:50:10 +01:00