instance_prototype -> prototype

This commit is contained in:
Andrew Morris
2023-06-23 09:06:01 +10:00
parent 5567ebcef0
commit a00a161973
6 changed files with 6 additions and 6 deletions

View File

@@ -41,7 +41,7 @@ impl BuiltinObject for ErrorBuiltin {
fn bo_as_class_data() -> Option<Rc<VsClass>> {
Some(Rc::new(VsClass {
constructor: SET_MESSAGE.to_val(),
instance_prototype: make_error_prototype(),
prototype: make_error_prototype(),
}))
}
}

View File

@@ -32,7 +32,7 @@ impl BuiltinObject for RangeErrorBuiltin {
fn bo_as_class_data() -> Option<Rc<VsClass>> {
Some(Rc::new(VsClass {
constructor: Val::Static(&SET_MESSAGE),
instance_prototype: make_range_error_prototype(),
prototype: make_range_error_prototype(),
}))
}
}

View File

@@ -40,7 +40,7 @@ impl BuiltinObject for TypeErrorBuiltin {
fn bo_as_class_data() -> Option<Rc<VsClass>> {
Some(Rc::new(VsClass {
constructor: Val::Static(&SET_MESSAGE),
instance_prototype: make_type_error_prototype(),
prototype: make_type_error_prototype(),
}))
}
}

View File

@@ -146,7 +146,7 @@ impl BytecodeDecoder {
BytecodeType::Builtin => BUILTIN_VALS[self.decode_varsize_uint()](),
BytecodeType::Class => VsClass {
constructor: self.decode_val(registers),
instance_prototype: self.decode_val(registers),
prototype: self.decode_val(registers),
}
.to_val(),
BytecodeType::BigInt => self.decode_bigint().to_val(),

View File

@@ -422,7 +422,7 @@ impl StackFrameTrait for BytecodeStackFrame {
let mut instance = VsObject {
string_map: Default::default(),
symbol_map: Default::default(),
prototype: Some(class.instance_prototype.clone()),
prototype: Some(class.prototype.clone()),
}
.to_val();

View File

@@ -7,7 +7,7 @@ use super::vs_value::Val;
#[derive(Debug)]
pub struct VsClass {
pub constructor: Val,
pub instance_prototype: Val,
pub prototype: Val,
}
impl VsClass {}