From 14ef50ce47edcd51b14019e5520134d0b17bc357 Mon Sep 17 00:00:00 2001 From: tofpie <75836434+tofpie@users.noreply.github.com> Date: Sat, 2 Jan 2021 16:12:29 +0100 Subject: [PATCH] Fix delete when the property is not configurable (#1024) * Fix delete when the property is not configurable * Implement suggestion Co-authored-by: Halid Odat Co-authored-by: tofpie Co-authored-by: Halid Odat --- boa/src/syntax/ast/node/operator/unary_op/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/boa/src/syntax/ast/node/operator/unary_op/mod.rs b/boa/src/syntax/ast/node/operator/unary_op/mod.rs index 2454b4ffab..7b3966d474 100644 --- a/boa/src/syntax/ast/node/operator/unary_op/mod.rs +++ b/boa/src/syntax/ast/node/operator/unary_op/mod.rs @@ -90,12 +90,15 @@ impl Executable for UnaryOp { get_const_field .obj() .run(context)? - .remove_property(get_const_field.field()), + .to_object(context)? + .delete(&get_const_field.field().into()), ), Node::GetField(ref get_field) => { let obj = get_field.obj().run(context)?; let field = &get_field.field().run(context)?; - let res = obj.remove_property(field.to_string(context)?.as_str()); + let res = obj + .to_object(context)? + .delete(&field.to_property_key(context)?); return Ok(Value::boolean(res)); } Node::Identifier(_) => Value::boolean(false),