fix(builtins/function/mod,function/arguments,function/bound,object/mod): convert panics to EngineError::Panic using js_expect#5001
Conversation
|
Note: set_function_name was changed from -> () to -> JsResult<()>. Call sites in vm/opcode/define/class/ and vm/opcode/set/property.rs were updated only to propagate this cascade ,remaining .expect() calls in those files are left because vm opcodes are a separate batch (after /builtins complete) in #3241 |
…d): convert panics to EngineError::Panic using js_expect
2c65f19 to
6091509
Compare
Test262 conformance changes
Tested main commit: |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5001 +/- ##
===========================================
+ Coverage 47.24% 58.29% +11.05%
===========================================
Files 476 559 +83
Lines 46892 61408 +14516
===========================================
+ Hits 22154 35798 +13644
- Misses 24738 25610 +872 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Part of #3241.
It changes the following:
core/engine/src/builtins/function/arguments.rs: converted 7 panics (7×js_expectondowncast_ref::<MappedArguments>()exotic method calls);binding_indicesretains.expect("binding must exist")as a documentedcompiler invariant — binding existence is guaranteed by
bound_names(formals)core/engine/src/builtins/function/mod.rs: converted 10 panics (2×downcast_ref::<OrdinaryFunction>(), 3×vm.frames.last()frame existence, 1×to_integer_or_infinity, 1×define_property_or_throwlength, 1×define_property_or_throwname, 1×new.targetobject cast, 1×set_function_name) to usejs_expectcore/engine/src/builtins/function/bound.rs: converted 2 panics (2×downcast_ref::<BoundFunction>()exotic method calls) to usejs_expectcore/engine/src/builtins/object/mod.rs: converted 10 panics (6×CreateDataPropertyOrThrowfrom_property_descriptor, 1×create_data_property_or_throwingroup_by,1×create_data_property_or_throwinget_own_property_descriptors,1×toObjectinto_string, 1×ToObjectinassign) to usejs_expect