Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions nova_vm/src/ecmascript/builtins/ecmascript_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1095,15 +1095,19 @@ pub(crate) fn set_function_name<'a>(
// a. Let description be name's [[Description]] value.
// b. If description is undefined, set name to the empty String.
// c. Else, set name to the string-concatenation of "[", description, and "]".
s.description(agent)
.map_or(String::EMPTY_STRING, |descriptor| {
let descriptor = descriptor.to_string_lossy_(agent);
String::from_string(
agent,
format!("{}[{descriptor}]", prefix_into_str(prefix)),
gc,
)
})
if let Some(descriptor) = s.description(agent) {
let descriptor = descriptor.to_string_lossy_(agent);
String::from_string(
agent,
format!("{}[{descriptor}]", prefix_into_str(prefix)),
gc,
)
} else if let Some(prefix) = prefix {
// Step 5 applies even when description is None
String::from_static_str(agent, prefix.into_str(), gc)
} else {
String::EMPTY_STRING
}
}

PropertyKey::Integer(integer) => String::from_string(
Expand Down
5 changes: 0 additions & 5 deletions tests/expectations.json
Original file line number Diff line number Diff line change
Expand Up @@ -5787,8 +5787,6 @@
"language/expressions/logical-or/tco-right.js": "FAIL",
"language/expressions/multiplication/S11.5.1_A4_T7.js": "FAIL",
"language/expressions/object/computed-property-name-topropertykey-before-value-evaluation.js": "FAIL",
"language/expressions/object/fn-name-accessor-get.js": "FAIL",
"language/expressions/object/fn-name-accessor-set.js": "FAIL",
"language/expressions/object/identifier-shorthand-static-init-await-valid.js": "FAIL",
"language/expressions/object/method-definition/generator-prototype-prop.js": "FAIL",
"language/expressions/object/method-definition/static-init-await-binding-accessor.js": "FAIL",
Expand Down Expand Up @@ -6157,8 +6155,6 @@
"language/statements/class/decorator/syntax/valid/decorator-member-expr-identifier-reference.js": "FAIL",
"language/statements/class/decorator/syntax/valid/decorator-parenthesized-expr-identifier-reference.js": "FAIL",
"language/statements/class/definition/constructor-strict-by-default.js": "FAIL",
"language/statements/class/definition/fn-name-accessor-get.js": "FAIL",
"language/statements/class/definition/fn-name-accessor-set.js": "FAIL",
"language/statements/class/elements/arrow-body-derived-cls-direct-eval-contains-superproperty-1.js": "FAIL",
"language/statements/class/elements/arrow-body-derived-cls-direct-eval-contains-superproperty-2.js": "FAIL",
"language/statements/class/elements/arrow-body-direct-eval-err-contains-arguments.js": "FAIL",
Expand Down Expand Up @@ -6540,7 +6536,6 @@
"staging/sm/Function/function-caller-restrictions.js": "FAIL",
"staging/sm/Function/function-name-assignment.js": "FAIL",
"staging/sm/Function/function-name-for.js": "FAIL",
"staging/sm/Function/function-name-method.js": "FAIL",
"staging/sm/Function/function-name-property.js": "FAIL",
"staging/sm/Function/function-toString-builtin-name.js": "FAIL",
"staging/sm/Function/function-toString-builtin.js": "FAIL",
Expand Down
4 changes: 2 additions & 2 deletions tests/metrics.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"results": {
"crash": 52,
"fail": 6785,
"pass": 40515,
"fail": 6780,
"pass": 40520,
"skip": 3326,
"timeout": 18,
"unresolved": 37
Expand Down
Loading