mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-01-12 23:18:03 -05:00
Emit type and range errors
This commit is contained in:
@@ -3,12 +3,12 @@ use std::rc::Rc;
|
||||
use num_bigint::BigInt;
|
||||
|
||||
use crate::format_err;
|
||||
|
||||
use super::stack_frame::StackFrame;
|
||||
use super::vs_array::VsArray;
|
||||
use super::vs_class::VsClass;
|
||||
use super::vs_object::VsObject;
|
||||
use super::vs_value::{LoadFunctionResult, Val, ValTrait, VsType};
|
||||
use crate::stack_frame::StackFrame;
|
||||
use crate::vs_array::VsArray;
|
||||
use crate::vs_class::VsClass;
|
||||
use crate::vs_object::VsObject;
|
||||
use crate::vs_value::{LoadFunctionResult, Val, ValTrait, VsType};
|
||||
use crate::{builtins::type_error_builtin::to_type_error, type_error};
|
||||
|
||||
pub struct NativeFrameFunction {
|
||||
pub make_frame: fn() -> StackFrame,
|
||||
@@ -66,7 +66,7 @@ impl ValTrait for NativeFrameFunction {
|
||||
}
|
||||
|
||||
fn submov(&mut self, _key: Val, _value: Val) -> Result<(), Val> {
|
||||
format_err!("TypeError: Cannot assign to subscript of native function")
|
||||
type_error!("Cannot assign to subscript of native function")
|
||||
}
|
||||
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
|
||||
Reference in New Issue
Block a user