Commit graph

86 commits

Author SHA1 Message Date
Anthony Ramine
109a297309 Simplify InterfaceConstructorBehavior 2016-09-06 10:13:55 +02:00
Anthony Ramine
6da56f7e67 Define interface members on the global object directly (fixes #4593) 2016-08-25 14:29:16 +02:00
Anthony Ramine
0729000b56 Pass a MutableHandleObject to create_global_object 2016-08-25 14:03:09 +02:00
Anthony Ramine
5f59bb2e0c Make create_global_object take a &'static Class 2016-08-25 14:03:08 +02:00
Anthony Ramine
a4f2159e36 Rename utils::create_dom_object to interface::create_global_object 2016-08-25 14:03:07 +02:00
Anthony Ramine
fa17814f12 Make define_constants unsafe 2016-08-25 13:07:46 +02:00
Ms2ger
89efccc426 Update SpiderMonkey to m-c bcf4ff0c3eef.
This currently breaks Servo on Android, because there are a number of
interdependent changes that cannot easily land serially in a way that
keeps it working throughout. We expect to fix this in the near future.
2016-07-28 13:05:56 +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
Anthony Ramine
3529803975 Implement [Unscopable] (fixes #11583) 2016-06-07 15:34:44 +02:00
Anthony Ramine
e179cb02ff Implement [Func] 2016-05-27 00:55:02 +02:00
Anthony Ramine
0d04acd50f Rename receiver to global in bindings::interface 2016-05-26 23:56:18 +02:00
Anthony Ramine
f0b53937d4 Remove some 'static lifetimes from bindings::interface 2016-05-26 23:56:17 +02:00
Anthony Ramine
25aaf78e98 Make define_constants private 2016-05-26 23:56:16 +02: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
adcecda047 Simplify how Prefable arrays are passed in bindings::interface 2016-05-26 23:55:36 +02:00
Anthony Ramine
4af3e9028d Use JS_NewStringCopyN for the representation of interface objects
This removes the need for the final null byte and we can make
NonCallbackInterfaceObjectClass::new safe again I guess.
2016-05-16 15:22:07 +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
a45f117838 Make NonCallbackInterfaceObjectClass::new unsafe 2016-04-25 10:51:07 +02:00
Guillaume Gomez
b6feab97e0 Make all interface objects share the same funToString 2016-03-21 11:57:48 +01:00
Anthony Ramine
ca979e115b Cache legacy callback interface objects in proto_or_icache_array
We need them to be cached to not instantiate them multiple times with
lazy initialisation.
2016-02-25 15:15:44 +01:00
Guillaume Gomez
bb9d3692c7 All interface objects now share the same hasInstance 2016-02-17 06:37:52 +01:00
Anthony Ramine
ae72d1dfbe Fix the hasInstance hook of interface objects
Step 2 wasn't properly implemented.
2016-02-15 14:12:53 +01:00
Anthony Ramine
e08f817058 Clean up imports in script::dom::bindings::interface 2016-02-15 12:59:18 +01:00
nxnfufunezn
e54929b4d7 Move ConstantSpec, NonNullJSNative and define_constants from utils to interface 2016-01-24 20:37:30 +05:30
apopiak
e2160cb3b9 implement NonCallbackInterfaceObjectClass::as_jsclass() 2016-01-14 12:51:16 +01:00
Anthony Ramine
d13da7d9b3 Fix prototypes of interface objects (fixes #2665) 2016-01-12 17:15:44 +01:00
Anthony Ramine
a1a9021aad Inline create_constructor into its only caller 2016-01-12 17:15:43 +01:00
Anthony Ramine
e1d3e4df2a Describe non-callback interface objects with JSClass structures
JS_NewFunction doesn't allow us to set the prototype of the interface objects.
2016-01-12 17:15:42 +01:00
Anthony Ramine
7693aecf15 Use the object prototype for callback interface objects
window.NodeFilter's prototype should be the object prototype.
2016-01-12 12:34:18 +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