avm2: Remove `is_boxed_primitive`, as we are no longer accepting boxed primitives on the stack.
This commit is contained in:
parent
71c953b6ac
commit
ee9341cb1c
|
@ -1233,7 +1233,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
|
||||||
|
|
||||||
let name_value = self.context.avm2.pop();
|
let name_value = self.context.avm2.pop();
|
||||||
let object = self.context.avm2.pop().coerce_to_object(self)?;
|
let object = self.context.avm2.pop().coerce_to_object(self)?;
|
||||||
if !name_value.is_boxed_primitive() {
|
if !name_value.is_primitive() {
|
||||||
if let Some(dictionary) = object.as_dictionary_object() {
|
if let Some(dictionary) = object.as_dictionary_object() {
|
||||||
let value =
|
let value =
|
||||||
dictionary.get_property_by_object(name_value.coerce_to_object(self)?);
|
dictionary.get_property_by_object(name_value.coerce_to_object(self)?);
|
||||||
|
@ -1279,7 +1279,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
|
||||||
|
|
||||||
let name_value = self.context.avm2.pop();
|
let name_value = self.context.avm2.pop();
|
||||||
let object = self.context.avm2.pop().coerce_to_object(self)?;
|
let object = self.context.avm2.pop().coerce_to_object(self)?;
|
||||||
if !name_value.is_boxed_primitive() {
|
if !name_value.is_primitive() {
|
||||||
if let Some(dictionary) = object.as_dictionary_object() {
|
if let Some(dictionary) = object.as_dictionary_object() {
|
||||||
dictionary.set_property_by_object(
|
dictionary.set_property_by_object(
|
||||||
name_value.coerce_to_object(self)?,
|
name_value.coerce_to_object(self)?,
|
||||||
|
@ -1339,7 +1339,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
|
||||||
|
|
||||||
let name_value = self.context.avm2.pop();
|
let name_value = self.context.avm2.pop();
|
||||||
let object = self.context.avm2.pop().coerce_to_object(self)?;
|
let object = self.context.avm2.pop().coerce_to_object(self)?;
|
||||||
if !name_value.is_boxed_primitive() {
|
if !name_value.is_primitive() {
|
||||||
if let Some(dictionary) = object.as_dictionary_object() {
|
if let Some(dictionary) = object.as_dictionary_object() {
|
||||||
dictionary.delete_property_by_object(
|
dictionary.delete_property_by_object(
|
||||||
name_value.coerce_to_object(self)?,
|
name_value.coerce_to_object(self)?,
|
||||||
|
@ -1423,7 +1423,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
|
||||||
let name_value = self.context.avm2.pop();
|
let name_value = self.context.avm2.pop();
|
||||||
|
|
||||||
if let Some(dictionary) = obj.as_dictionary_object() {
|
if let Some(dictionary) = obj.as_dictionary_object() {
|
||||||
if !name_value.is_boxed_primitive() {
|
if !name_value.is_primitive() {
|
||||||
let obj_key = name_value.coerce_to_object(self)?;
|
let obj_key = name_value.coerce_to_object(self)?;
|
||||||
self.context
|
self.context
|
||||||
.avm2
|
.avm2
|
||||||
|
|
|
@ -259,14 +259,6 @@ impl<'gc> Value<'gc> {
|
||||||
!matches!(self, Value::Object(_))
|
!matches!(self, Value::Object(_))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Yields `true` if the given value is a primitive value, boxed or no.
|
|
||||||
pub fn is_boxed_primitive(&self) -> bool {
|
|
||||||
match self {
|
|
||||||
Value::Object(o) => o.as_primitive().is_some(),
|
|
||||||
_ => true,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Coerce the value to a boolean.
|
/// Coerce the value to a boolean.
|
||||||
///
|
///
|
||||||
/// Boolean coercion happens according to the rules specified in the ES4
|
/// Boolean coercion happens according to the rules specified in the ES4
|
||||||
|
|
Loading…
Reference in New Issue