Hard code constant checking.

This commit is contained in:
Stephen Chung
2022-12-03 16:20:13 +08:00
parent ffc8a7f85c
commit 55922b5c20
16 changed files with 474 additions and 374 deletions

View File

@@ -261,8 +261,7 @@ pub mod array_functions {
m1 += m2;
s1 += s2;
_ctx.engine()
.raise_err_if_over_data_size_limit((a1, m1, s1))?;
_ctx.engine().throw_on_size((a1, m1, s1))?;
guard.push(item.clone());
arr_len += 1;

View File

@@ -81,8 +81,7 @@ pub mod blob_functions {
// Check if blob will be over max size limit
#[cfg(not(feature = "unchecked"))]
_ctx.engine()
.raise_err_if_over_data_size_limit((len, 0, 0))?;
_ctx.engine().throw_on_size((len, 0, 0))?;
let mut blob = Blob::new();
blob.resize(len, (value & 0x0000_00ff) as u8);

View File

@@ -220,7 +220,7 @@ fn collect_fn_metadata(
"comments".into(),
func.comments
.iter()
.map(|s| engine.get_interned_string(s.as_ref()).into())
.map(|s| engine.get_interned_string(s.as_str()).into())
.collect::<Array>()
.into(),
);