mirror of
https://github.com/servo/servo.git
synced 2025-08-02 04:00:32 +01:00
Rename FailureUnknown to JSFailed.
This commit is contained in:
parent
3dac90b49e
commit
4873682a3c
4 changed files with 14 additions and 14 deletions
|
@ -4645,7 +4645,7 @@ class CGBindingRoot(CGThing):
|
||||||
'dom::bindings::codegen::{PrototypeList, RegisterBindings, UnionTypes}',
|
'dom::bindings::codegen::{PrototypeList, RegisterBindings, UnionTypes}',
|
||||||
'dom::bindings::codegen::Bindings::*',
|
'dom::bindings::codegen::Bindings::*',
|
||||||
'dom::bindings::error::{Fallible, Error, ErrorResult}',
|
'dom::bindings::error::{Fallible, Error, ErrorResult}',
|
||||||
'dom::bindings::error::Error::FailureUnknown',
|
'dom::bindings::error::Error::JSFailed',
|
||||||
'dom::bindings::error::throw_dom_exception',
|
'dom::bindings::error::throw_dom_exception',
|
||||||
'dom::bindings::error::throw_type_error',
|
'dom::bindings::error::throw_type_error',
|
||||||
'dom::bindings::proxyhandler',
|
'dom::bindings::proxyhandler',
|
||||||
|
@ -4814,14 +4814,14 @@ class CGCallback(CGClass):
|
||||||
|
|
||||||
setupCall = ("let s = CallSetup::new(self, aExceptionHandling);\n"
|
setupCall = ("let s = CallSetup::new(self, aExceptionHandling);\n"
|
||||||
"if s.get_context().is_null() {\n"
|
"if s.get_context().is_null() {\n"
|
||||||
" return Err(FailureUnknown);\n"
|
" return Err(JSFailed);\n"
|
||||||
"}\n")
|
"}\n")
|
||||||
|
|
||||||
bodyWithThis = string.Template(
|
bodyWithThis = string.Template(
|
||||||
setupCall+
|
setupCall+
|
||||||
"let thisObjJS = wrap_call_this_object(s.get_context(), thisObj);\n"
|
"let thisObjJS = wrap_call_this_object(s.get_context(), thisObj);\n"
|
||||||
"if thisObjJS.is_null() {\n"
|
"if thisObjJS.is_null() {\n"
|
||||||
" return Err(FailureUnknown);\n"
|
" return Err(JSFailed);\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"return ${methodName}(${callArgs});").substitute({
|
"return ${methodName}(${callArgs});").substitute({
|
||||||
"callArgs" : ", ".join(argnamesWithThis),
|
"callArgs" : ", ".join(argnamesWithThis),
|
||||||
|
@ -4946,7 +4946,7 @@ class CallbackMember(CGNativeMember):
|
||||||
jsObjectsArePtr=True)
|
jsObjectsArePtr=True)
|
||||||
# We have to do all the generation of our body now, because
|
# We have to do all the generation of our body now, because
|
||||||
# the caller relies on us throwing if we can't manage it.
|
# the caller relies on us throwing if we can't manage it.
|
||||||
self.exceptionCode= "return Err(FailureUnknown);"
|
self.exceptionCode = "return Err(JSFailed);"
|
||||||
self.body = self.getImpl()
|
self.body = self.getImpl()
|
||||||
|
|
||||||
def getImpl(self):
|
def getImpl(self):
|
||||||
|
@ -5076,7 +5076,7 @@ class CallbackMember(CGNativeMember):
|
||||||
"CallSetup s(CallbackPreserveColor(), aRv, aExceptionHandling);\n"
|
"CallSetup s(CallbackPreserveColor(), aRv, aExceptionHandling);\n"
|
||||||
"JSContext* cx = s.get_context();\n"
|
"JSContext* cx = s.get_context();\n"
|
||||||
"if (!cx) {\n"
|
"if (!cx) {\n"
|
||||||
" return Err(FailureUnknown);\n"
|
" return Err(JSFailed);\n"
|
||||||
"}\n")
|
"}\n")
|
||||||
|
|
||||||
def getArgcDecl(self):
|
def getArgcDecl(self):
|
||||||
|
@ -5121,7 +5121,7 @@ class CallbackMethod(CallbackMember):
|
||||||
" ${argc}, ${argv}, &mut rval)\n"
|
" ${argc}, ${argv}, &mut rval)\n"
|
||||||
"};\n"
|
"};\n"
|
||||||
"if ok == 0 {\n"
|
"if ok == 0 {\n"
|
||||||
" return Err(FailureUnknown);\n"
|
" return Err(JSFailed);\n"
|
||||||
"}\n").substitute(replacements)
|
"}\n").substitute(replacements)
|
||||||
|
|
||||||
class CallCallback(CallbackMethod):
|
class CallCallback(CallbackMethod):
|
||||||
|
@ -5158,7 +5158,7 @@ class CallbackOperationBase(CallbackMethod):
|
||||||
}
|
}
|
||||||
getCallableFromProp = string.Template(
|
getCallableFromProp = string.Template(
|
||||||
'match self.parent.get_callable_property(cx, "${methodName}") {\n'
|
'match self.parent.get_callable_property(cx, "${methodName}") {\n'
|
||||||
' Err(_) => return Err(FailureUnknown),\n'
|
' Err(_) => return Err(JSFailed),\n'
|
||||||
' Ok(callable) => callable,\n'
|
' Ok(callable) => callable,\n'
|
||||||
'}').substitute(replacements)
|
'}').substitute(replacements)
|
||||||
if not self.singleOperation:
|
if not self.singleOperation:
|
||||||
|
@ -5201,7 +5201,7 @@ class CallbackGetter(CallbackMember):
|
||||||
}
|
}
|
||||||
return string.Template(
|
return string.Template(
|
||||||
'if (!JS_GetProperty(cx, mCallback, "${attrName}", &rval)) {\n'
|
'if (!JS_GetProperty(cx, mCallback, "${attrName}", &rval)) {\n'
|
||||||
' return Err(FailureUnknown);\n'
|
' return Err(JSFailed);\n'
|
||||||
'}\n').substitute(replacements);
|
'}\n').substitute(replacements);
|
||||||
|
|
||||||
class CallbackSetter(CallbackMember):
|
class CallbackSetter(CallbackMember):
|
||||||
|
@ -5227,7 +5227,7 @@ class CallbackSetter(CallbackMember):
|
||||||
return string.Template(
|
return string.Template(
|
||||||
'MOZ_ASSERT(argv.length() == 1);\n'
|
'MOZ_ASSERT(argv.length() == 1);\n'
|
||||||
'if (!JS_SetProperty(cx, mCallback, "${attrName}", ${argv})) {\n'
|
'if (!JS_SetProperty(cx, mCallback, "${attrName}", ${argv})) {\n'
|
||||||
' return Err(FailureUnknown);\n'
|
' return Err(JSFailed);\n'
|
||||||
'}\n').substitute(replacements)
|
'}\n').substitute(replacements)
|
||||||
|
|
||||||
def getArgcDecl(self):
|
def getArgcDecl(self):
|
||||||
|
|
|
@ -52,8 +52,8 @@ pub enum Error {
|
||||||
DataClone,
|
DataClone,
|
||||||
/// NoModificationAllowedError
|
/// NoModificationAllowedError
|
||||||
NoModificationAllowedError,
|
NoModificationAllowedError,
|
||||||
/// Unknown failure
|
/// A JavaScript exception is already pending.
|
||||||
FailureUnknown,
|
JSFailed,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The return type for IDL operations that can throw DOM exceptions.
|
/// The return type for IDL operations that can throw DOM exceptions.
|
||||||
|
|
|
@ -58,7 +58,7 @@ impl DOMErrorName {
|
||||||
Error::Timeout => DOMErrorName::TimeoutError,
|
Error::Timeout => DOMErrorName::TimeoutError,
|
||||||
Error::DataClone => DOMErrorName::DataCloneError,
|
Error::DataClone => DOMErrorName::DataCloneError,
|
||||||
Error::NoModificationAllowedError => DOMErrorName::NoModificationAllowedError,
|
Error::NoModificationAllowedError => DOMErrorName::NoModificationAllowedError,
|
||||||
Error::FailureUnknown => panic!(),
|
Error::JSFailed => panic!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ use dom::bindings::codegen::Bindings::FunctionBinding::Function;
|
||||||
use dom::bindings::codegen::Bindings::WorkerGlobalScopeBinding::WorkerGlobalScopeMethods;
|
use dom::bindings::codegen::Bindings::WorkerGlobalScopeBinding::WorkerGlobalScopeMethods;
|
||||||
use dom::bindings::codegen::InheritTypes::DedicatedWorkerGlobalScopeCast;
|
use dom::bindings::codegen::InheritTypes::DedicatedWorkerGlobalScopeCast;
|
||||||
use dom::bindings::error::{ErrorResult, Fallible};
|
use dom::bindings::error::{ErrorResult, Fallible};
|
||||||
use dom::bindings::error::Error::{Syntax, Network, FailureUnknown};
|
use dom::bindings::error::Error::{Syntax, Network, JSFailed};
|
||||||
use dom::bindings::global::GlobalRef;
|
use dom::bindings::global::GlobalRef;
|
||||||
use dom::bindings::js::{MutNullableJS, JSRef, Temporary};
|
use dom::bindings::js::{MutNullableJS, JSRef, Temporary};
|
||||||
use dom::bindings::utils::Reflectable;
|
use dom::bindings::utils::Reflectable;
|
||||||
|
@ -118,7 +118,7 @@ impl<'a> WorkerGlobalScopeMethods for JSRef<'a, WorkerGlobalScope> {
|
||||||
Ok(_) => (),
|
Ok(_) => (),
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
println!("evaluate_script failed");
|
println!("evaluate_script failed");
|
||||||
return Err(FailureUnknown);
|
return Err(JSFailed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue