Bug 905392 - Need way to throw web-console-visible exception-message from JS-implemented webidl object - bustage fix on a CLOSED TREE.

This commit is contained in:
Peter Van der Beken 2013-09-06 15:27:25 +02:00
parent 80dd167737
commit 19de89f34e
2 changed files with 6 additions and 5 deletions

View File

@ -85,11 +85,12 @@ Throw(JSContext* cx, nsresult rv)
return false;
}
template<bool mainThread, bool reportJSContentExceptions = false>
template<bool mainThread>
inline bool
ThrowMethodFailedWithDetails(JSContext* cx, ErrorResult& rv,
const char* ifaceName,
const char* memberName)
const char* memberName,
bool reportJSContentExceptions = false)
{
if (rv.IsTypeError()) {
rv.ReportTypeError(cx);

View File

@ -4929,11 +4929,11 @@ if (!${obj}) {
jsImplemented = ""
if self.descriptor.interface.isJSImplemented():
jsImplemented = ", true"
return CGGeneric('return ThrowMethodFailedWithDetails<%s%s>(cx, rv, "%s", "%s");'
return CGGeneric('return ThrowMethodFailedWithDetails<%s>(cx, rv, "%s", "%s"%s);'
% (toStringBool(not self.descriptor.workers),
jsImplemented,
self.descriptor.interface.identifier.name,
self.idlNode.identifier.name))
self.idlNode.identifier.name,
jsImplemented))
def define(self):
return (self.cgRoot.define() + "\n" + self.wrap_return_value())