Global Metrics
path: .metrics.loc.lloc
old: 9.0
new: 10.0
path: .metrics.halstead.effort
old: 3249.3712467909604
new: 3202.40534204949
path: .metrics.halstead.N1
old: 43.0
new: 42.0
path: .metrics.halstead.volume
old: 337.59701265360627
new: 341.32219946608984
path: .metrics.halstead.difficulty
old: 9.625
new: 9.382352941176473
path: .metrics.halstead.N2
old: 28.0
new: 29.0
path: .metrics.halstead.vocabulary
old: 27.0
new: 28.0
path: .metrics.halstead.time
old: 180.52062482172
new: 177.91140789163833
path: .metrics.halstead.estimated_program_length
old: 102.05374780501026
new: 107.54061610626604
path: .metrics.halstead.purity_ratio
old: 1.4373767296480318
new: 1.5146565648769863
path: .metrics.halstead.n2
old: 16.0
new: 17.0
path: .metrics.halstead.bugs
old: 0.07312709153904351
new: 0.07242073802670723
path: .metrics.halstead.level
old: 0.1038961038961039
new: 0.10658307210031348
path: .metrics.mi.mi_sei
old: 82.16668204010037
new: 82.08435505811485
path: .metrics.mi.mi_visual_studio
old: 45.69498977391832
new: 45.661618595294186
path: .metrics.mi.mi_original
old: 78.13843251340033
new: 78.08136779795306
Code
// |reftest| shell-option(--enable-private-methods) skip-if(!xulRuntime.shell) async -- requires shell-options
// This file was procedurally generated from the following sources:
// - src/async-functions/returns-async-arrow-returns-arguments-from-parent-function.case
// - src/async-functions/evaluation/async-class-decl-private-method.template
/*---
description: Async function returns an async function. (Async private method as a ClassDeclaration element)
esid: prod-AsyncMethod
features: [async-functions, class-methods-private]
flags: [generated, async]
info: |
ClassElement :
PrivateMethodDefinition
MethodDefinition :
AsyncMethod
Async Function Definitions
AsyncMethod :
async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
---*/
let count = 0;
class C {
async #method(x) {
let a = arguments;
return async () => a === arguments;
}
async method(x) {
return this.#method(x);
}
}
// Stores a reference `asyncFn` for case evaluation
let c = new C();
let asyncFn = c.method.bind(c);
asyncFn().then(retFn => {
count++;
return retFn();
}).then(result => {
assert.sameValue(result, true);
assert.sameValue(count, 1);
}).then($DONE, $DONE);