diff --git a/boa_engine/src/value/mod.rs b/boa_engine/src/value/mod.rs index 5d36e80768..6cf5578bcc 100644 --- a/boa_engine/src/value/mod.rs +++ b/boa_engine/src/value/mod.rs @@ -21,9 +21,9 @@ use crate::{ Number, }, error::JsNativeError, - js_string, object::{JsObject, ObjectData}, property::{PropertyDescriptor, PropertyKey}, + string::utf16, symbol::JsSymbol, Context, JsBigInt, JsResult, JsString, }; @@ -526,7 +526,7 @@ impl JsValue { JsObject::from_proto_and_data(prototype, ObjectData::string(string.clone())); // Make sure the correct length is set on our new string object object.insert_property( - js_string!("length"), + utf16!("length"), PropertyDescriptor::builder() .value(string.len()) .writable(false) diff --git a/boa_engine/src/vm/opcode/get/property.rs b/boa_engine/src/vm/opcode/get/property.rs index a3fd32a8f0..53909debc2 100644 --- a/boa_engine/src/vm/opcode/get/property.rs +++ b/boa_engine/src/vm/opcode/get/property.rs @@ -1,7 +1,7 @@ use crate::{ property::PropertyKey, vm::{opcode::Operation, ShouldExit}, - Context, JsResult, JsString, + Context, JsResult, }; /// `GetPropertyByName` implements the Opcode Operation for `Opcode::GetPropertyByName` @@ -25,11 +25,8 @@ impl Operation for GetPropertyByName { value.to_object(context)? }; - let key: PropertyKey = context - .interner() - .resolve_expect(context.vm.frame().code_block.names[index as usize].sym()) - .into_common::(false) - .into(); + let name = context.vm.frame().code_block.names[index as usize]; + let key: PropertyKey = context.interner().resolve_expect(name.sym()).utf16().into(); let result = object.__get__(&key, value, context)?; context.vm.push(result); diff --git a/boa_engine/src/vm/opcode/set/property.rs b/boa_engine/src/vm/opcode/set/property.rs index c866368fae..324408a3a4 100644 --- a/boa_engine/src/vm/opcode/set/property.rs +++ b/boa_engine/src/vm/opcode/set/property.rs @@ -29,11 +29,7 @@ impl Operation for SetPropertyByName { }; let name = context.vm.frame().code_block.names[index as usize]; - let name: PropertyKey = context - .interner() - .resolve_expect(name.sym()) - .into_common::(false) - .into(); + let name: PropertyKey = context.interner().resolve_expect(name.sym()).utf16().into(); //object.set(name, value.clone(), context.vm.frame().code.strict, context)?; let succeeded = object.__set__(name.clone(), value.clone(), receiver, context)?;