mirror of
https://github.com/servo/servo.git
synced 2025-06-13 10:54:29 +00:00
Throw a TypeError when unwrapping a this object fails.
This commit is contained in:
parent
715ae6ab55
commit
be7ef50f27
1 changed files with 4 additions and 1 deletions
|
@ -2377,7 +2377,10 @@ class CGAbstractBindingMethod(CGAbstractExternMethod):
|
||||||
CGAbstractExternMethod.__init__(self, descriptor, name, "JSBool", args)
|
CGAbstractExternMethod.__init__(self, descriptor, name, "JSBool", args)
|
||||||
|
|
||||||
if unwrapFailureCode is None:
|
if unwrapFailureCode is None:
|
||||||
self.unwrapFailureCode = "return 0; //XXXjdm return Throw(cx, rv);"
|
self.unwrapFailureCode = (
|
||||||
|
'throw_type_error(cx, "\\"this\\" object does not '
|
||||||
|
'implement interface %s.");\n'
|
||||||
|
'return 0;' % descriptor.interface.identifier.name)
|
||||||
else:
|
else:
|
||||||
self.unwrapFailureCode = unwrapFailureCode
|
self.unwrapFailureCode = unwrapFailureCode
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue