Move comment

This commit is contained in:
Andrew Morris
2023-03-13 14:28:34 +11:00
parent 253b06141c
commit 4de8f51495
2 changed files with 5 additions and 2 deletions

View File

@@ -56,8 +56,12 @@ impl ValTrait for StringBuiltin {
}
fn sub(&self, key: Val) -> Val {
// Not supported: fromCharCode.
// See charAt etc in string_methods.rs.
match key.val_to_string().as_str() {
"fromCodePoint" => Val::Static(&FROM_CODE_POINT),
// "fromCharCode" => Val::Static(&FROM_CHAR_CODE),
_ => Val::Undefined,
}
}

View File

@@ -29,7 +29,7 @@ pub fn op_sub_string(string_data: &Rc<String>, subscript: &Val) -> Val {
}
pub fn get_string_method(method: &str) -> Val {
// Not supported: charAt, charCodeAt, fromCharCode.
// Not supported: charAt, charCodeAt.
//
// These methods are inherently about utf16, which is not how strings work in ValueScript. They
// also have some particularly strange behavior, like:
@@ -47,7 +47,6 @@ pub fn get_string_method(method: &str) -> Val {
"codePointAt" => Val::Static(&CODE_POINT_AT),
"concat" => Val::Static(&CONCAT),
"endsWith" => Val::Static(&ENDS_WITH),
// "fromCharCode" => Val::Static(&FROM_CHAR_CODE),
_ => Val::Undefined,
}
}