[oden] Garbage assets, need to rewrite to IO
This commit is contained in:
parent
75fcc427ac
commit
17805fa4a6
17 changed files with 240 additions and 94 deletions
|
|
@ -7,21 +7,21 @@ pub trait TryIntoValue {
|
|||
impl TryIntoValue for u8 {
|
||||
#[inline]
|
||||
fn try_into_value(self, ctx: &ContextRef) -> ValueResult {
|
||||
ctx.new_u64(self)
|
||||
ctx.new_u32(self)
|
||||
}
|
||||
}
|
||||
|
||||
impl TryIntoValue for u16 {
|
||||
#[inline]
|
||||
fn try_into_value(self, ctx: &ContextRef) -> ValueResult {
|
||||
ctx.new_u64(self)
|
||||
ctx.new_u32(self)
|
||||
}
|
||||
}
|
||||
|
||||
impl TryIntoValue for u32 {
|
||||
#[inline]
|
||||
fn try_into_value(self, ctx: &ContextRef) -> ValueResult {
|
||||
ctx.new_u64(self)
|
||||
ctx.new_u32(self)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -116,7 +116,7 @@ impl TryIntoValue for Error {
|
|||
}
|
||||
Error::ConversionError(e) => Err(Error::ConversionError(e)),
|
||||
Error::RustFunctionError(e) => Err(Error::RustFunctionError(e)),
|
||||
Error::Exception(v, d) => Err(Error::Exception(v.dup(ctx), d)),
|
||||
Error::Exception(v, d, s) => Err(Error::Exception(v.dup(ctx), d, s)),
|
||||
Error::OutOfMemory => Err(Error::OutOfMemory),
|
||||
Error::IOError(e) => Err(Error::IOError(e)),
|
||||
Error::ParseError(name, err) => Err(Error::ParseError(name, err)),
|
||||
|
|
@ -135,8 +135,15 @@ impl<T: TryIntoValue> TryIntoValue for Option<T> {
|
|||
#[inline]
|
||||
fn try_into_value(self, ctx: &ContextRef) -> ValueResult {
|
||||
match self {
|
||||
None => Ok(ctx.undefined()),
|
||||
None => Ok(ctx.null()),
|
||||
Some(v) => v.try_into_value(ctx),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl TryIntoValue for () {
|
||||
#[inline]
|
||||
fn try_into_value(self, ctx: &ContextRef) -> ValueResult {
|
||||
Ok(ctx.undefined())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue