Global Metrics
path: .metrics.halstead.difficulty
old: 19.795454545454547
new: 19.5
path: .metrics.halstead.length
old: 177.0
new: 179.0
path: .metrics.halstead.bugs
old: 0.22870501279286268
new: 0.22932954117514864
path: .metrics.halstead.effort
old: 17971.95851984897
new: 18045.62321753439
path: .metrics.halstead.volume
old: 907.883093999259
new: 925.416575258174
path: .metrics.halstead.n2
old: 22.0
new: 23.0
path: .metrics.halstead.estimated_program_length
old: 146.21321194585474
new: 152.14764132514549
path: .metrics.halstead.purity_ratio
old: 0.8260633443268629
new: 0.8499868230455055
path: .metrics.halstead.vocabulary
old: 35.0
new: 36.0
path: .metrics.halstead.N2
old: 67.0
new: 69.0
path: .metrics.halstead.time
old: 998.4421399916096
new: 1002.534623196355
path: .metrics.halstead.level
old: 0.0505166475315729
new: 0.05128205128205128
path: .metrics.loc.lloc
old: 28.0
new: 30.0
path: .metrics.mi.mi_original
old: 56.55039819170109
new: 56.45093067521507
path: .metrics.mi.mi_sei
old: 52.48555103952778
new: 52.34204974676385
path: .metrics.mi.mi_visual_studio
old: 33.070408299240405
new: 33.012240160944486
path: .metrics.nexits.average
old: 1.5
new: 1.25
path: .metrics.nexits.sum
old: 6.0
new: 5.0
Code
// |reftest| shell-option(--enable-private-fields) skip-if(!xulRuntime.shell) async -- requires shell-options
// This file was procedurally generated from the following sources:
// - src/class-elements/grammar-privatename-identifier-semantics-stringvalue.case
// - src/class-elements/productions/cls-decl-after-same-line-async-gen.template
/*---
description: PrivateName Static Semantics, StringValue (field definitions after an async generator in the same line)
esid: prod-FieldDefinition
features: [class-fields-private, class, class-fields-public, async-iteration]
flags: [generated, async]
includes: [propertyHelper.js]
info: |
ClassElement :
MethodDefinition
static MethodDefinition
FieldDefinition ;
;
FieldDefinition :
ClassElementName Initializer _opt
ClassElementName :
PropertyName
PrivateName
PrivateName ::
# IdentifierName
IdentifierName ::
IdentifierStart
IdentifierName IdentifierPart
IdentifierStart ::
UnicodeIDStart
$
_
\ UnicodeEscapeSequence
IdentifierPart::
UnicodeIDContinue
$
\ UnicodeEscapeSequence
UnicodeIDStart::
any Unicode code point with the Unicode property "ID_Start"
UnicodeIDContinue::
any Unicode code point with the Unicode property "ID_Continue"
NOTE 3
The sets of code points with Unicode properties "ID_Start" and
"ID_Continue" include, respectively, the code points with Unicode
properties "Other_ID_Start" and "Other_ID_Continue".
1. Return the String value consisting of the sequence of code
units corresponding to PrivateName. In determining the sequence
any occurrences of \ UnicodeEscapeSequence are first replaced
with the code point represented by the UnicodeEscapeSequence
and then the code points of the entire PrivateName are converted
to code units by UTF16Encoding (10.1.1) each code point.
---*/
class C {
async *m() { return 42; } #\u{6F};
#\u2118;
#ZW_\u200C_NJ;
#ZW_\u200D_J;;
o(value) {
this.#o = value;
return this.#o;
}
℘(value) {
this.#℘ = value;
return this.#℘;
}
ZW__NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
this.#ZW__NJ = value;
return this.#ZW__NJ;
}
ZW__J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD
this.#ZW__J = value;
return this.#ZW__J;
}
}
var c = new C();
assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
assert.sameValue(c.m, C.prototype.m);
verifyProperty(C.prototype, "m", {
enumerable: false,
configurable: true,
writable: true,
}, {restore: true});
c.m().next().then(function(v) {
assert.sameValue(v.value, 42);
assert.sameValue(v.done, true);
function assertions() {
// Cover $DONE handler for async cases.
function $DONE(error) {
if (error) {
throw new Test262Error('Test262:AsyncTestFailure')
}
}
assert.sameValue(c.o(1), 1);
assert.sameValue(c.℘(1), 1);
assert.sameValue(c.ZW__NJ(1), 1);
assert.sameValue(c.ZW__J(1), 1);
}
return Promise.resolve(assertions());
}).then($DONE, $DONE);