Commit graph

16 commits

Author SHA1 Message Date
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