mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 774705 - Part b: Throw a TypeError when trying to construct an interface without a constructor; r=bz
This commit is contained in:
parent
3a16363144
commit
e8f42a2d03
@ -403,13 +403,7 @@ QueryInterface(JSContext* cx, unsigned argc, JS::Value* vp)
|
||||
JSBool
|
||||
ThrowingConstructor(JSContext* cx, unsigned argc, JS::Value* vp)
|
||||
{
|
||||
return Throw<true>(cx, NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
JSBool
|
||||
ThrowingConstructorWorkers(JSContext* cx, unsigned argc, JS::Value* vp)
|
||||
{
|
||||
return Throw<false>(cx, NS_ERROR_FAILURE);
|
||||
return ThrowErrorMessage(cx, MSG_ILLEGAL_CONSTRUCTOR);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -690,8 +690,6 @@ JSBool
|
||||
QueryInterface(JSContext* cx, unsigned argc, JS::Value* vp);
|
||||
JSBool
|
||||
ThrowingConstructor(JSContext* cx, unsigned argc, JS::Value* vp);
|
||||
JSBool
|
||||
ThrowingConstructorWorkers(JSContext* cx, unsigned argc, JS::Value* vp);
|
||||
|
||||
template<class T>
|
||||
class NonNull
|
||||
|
@ -1118,7 +1118,7 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
|
||||
constructHook = CONSTRUCT_HOOK_NAME
|
||||
constructArgs = methodLength(self.descriptor.interface.ctor())
|
||||
else:
|
||||
constructHook = "ThrowingConstructorWorkers" if self.descriptor.workers else "ThrowingConstructor"
|
||||
constructHook = "ThrowingConstructor"
|
||||
constructArgs = 0
|
||||
|
||||
call = CGGeneric(("return dom::CreateInterfaceObjects(aCx, aGlobal, aReceiver, parentProto,\n"
|
||||
|
@ -24,3 +24,4 @@ MSG_DEF(MSG_MISSING_ARGUMENTS, 1, "Not enough arguments to {0}.")
|
||||
MSG_DEF(MSG_NOT_OBJECT, 0, "Value not an object.")
|
||||
MSG_DEF(MSG_DOES_NOT_IMPLEMENT_INTERFACE, 1, "Value does not implement interface {0}.")
|
||||
MSG_DEF(MSG_NOT_IN_UNION, 1, "Value could not be converted to any of: {0}.")
|
||||
MSG_DEF(MSG_ILLEGAL_CONSTRUCTOR, 0, "Illegal constructor.")
|
||||
|
@ -1,5 +1,4 @@
|
||||
{
|
||||
"XMLHttpRequestUpload interface: existence and properties of interface object": true,
|
||||
"XMLHttpRequest interface constructor": true,
|
||||
"FormData interface: existence and properties of interface object": true,
|
||||
"FormData interface constructor": true,
|
||||
|
Loading…
Reference in New Issue
Block a user