The following proposed change modifies the semantics this test was
originally written to verify:
Normative: Allow null or undefined in Reference Records
https://github.com/tc39/ecma262/pull/2267
* Simplify find_cases
* Improve help text
* Improve YAML-capturing regex
* Use built-in dedenting
* Fix use of built-in dedenting
* Fix use of built-in dedenting for Python 3
Since https://github.com/tc39/ecma262/pull/1490, the "length" and "name"
properties of a class are defined before any static methods. This is
tested by #2057, in test/language/computed-property-names of all places.
At the same time, static methods with "name" as the name would overwrite
the original property, but retain the original property enumeration
order. This was not previously tested. In fact, the overwriting behavior
was not tested at all for the "length" property.
This commit mends both holes in test coverage.
* Temporal.now.plainDateTime: import tests from prop
* Add required metadata
* Correct invalid test
Ensure the error is thrown due to the invocation of the provided method.
Add a separate test to verify how the method is invoked.
* Remove duplicated assertions
* Improve coverage
* Rewrite test to focus on Calendar parameter
The observable interactions with the "timeZone" parameter are verified
by another test which is named for that purpose.
* Remove non-standard test
This test's title suggests that it was intended to verify the behavior
when the "calendar" parameter was undefined. The expected behavior in
that case depends on the presence of a builtin calendar named
"undefined." Test262 cannot definitively assert the presence or absence
of such a calendar.
In contrast to the title, the test body actually uses the calendar name
"japanese." Test262 cannot definitively assert the presence or absence
of such a calendar.
* Add tests for "Class Static Init. Blocks" proposal
This proposal is currently at "stage 3" in TC39's standardization
process.
* fixup! Add tests for "Class Static Init. Blocks" proposal
* Correct identifier reference
* Update tests for grammar
* Update tests for identifiers
* Add tests for scope derivation
* ResizableArrayBuffer: TypedArray.prototype.set
* Resizable ArrayBuffer: TypedArray methods
The files in this patch are highly similar. Only the test for
`TypedArray.prototype.copyWithin` was written manually. The others were
generated from that test via the following script:
#!/bin/bash
set -eu
names_cb='
every
filter
find
findIndex
forEach
map
reduce
reduceRight
some
'
names_num='
at
fill
includes
indexOf
join
lastIndexOf
slice
'
names_none='
entries
values
keys
reverse
sort
toLocaleString
values
'
for name in $(printf "${names_cb} ${names_num} ${names_none}"); do
lower=$(echo ${name} | tr '[:upper:]' '[:lower:]')
if echo "$names_cb" | grep -xq $name; then
value='() => {}'
elif echo "$names_num" | grep -xq $name; then
value='0'
else
value=''
fi
if [[ "${name}" == 'at' ]]; then
features_addition='TypedArray.prototype.at, '
else
features_addition=''
fi
sed \
-e "s/copywithin/${lower}/g" \
-e "s/copyWithin/${name}/g" \
-e "s/${name}(.*);/${name}(${value});/g" \
-e "s/resizable-arraybuffer/${features_addition}resizable-arraybuffer/g" \
./test/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-this-out-of-bounds.js \
> ./test/built-ins/TypedArray/prototype/${name}/return-abrupt-from-this-out-of-bounds.js
done
* Add "feature" for "Resizable ArrayBuffer" proposal
* Resizable ArrayBuffer: DataView methods
The files in this patch are highly similar. Only the test for
`DataView.prototype.getBigInt64` and `DataView.prototype.setBigInt64`
were written manually. The others were generated from those files via
the following script:
#!/bin/bash
set -eu
names='
BigUint64
Float32
Float64
Int16
Int32
Int8
Uint16
Uint32
Uint8
'
for name in ${names}; do
lower=$(echo ${name} | tr '[:upper:]' '[:lower:]')
if [ ${name} == 'BigUint64' ]; then
replace_bigints=''
else
replace_bigints='-e s/\b\([0-9]\+\)n\b/\1/g'
fi
sed \
-e "s/getbigint64/get${lower}/g" \
-e "s/getBigInt64/get${name}/g" \
${replace_bigints} \
./test/built-ins/DataView/prototype/getBigInt64/resizable-buffer.js \
> ./test/built-ins/DataView/prototype/get${name}/resizable-buffer.js
sed \
-e "s/setbigint64/set${lower}/g" \
-e "s/setBigInt64/set${name}/g" \
${replace_bigints} \
./test/built-ins/DataView/prototype/setBigInt64/resizable-buffer.js \
> ./test/built-ins/DataView/prototype/set${name}/resizable-buffer.js
done
* Fix test for only {localeMatcher: "lookup"}
The expectation that "sr-Thai-RS" would be returned is only true with the
9.2.2 BestAvailableLocale ( availableLocales, locale )
https://tc39.es/ecma402/#sec-bestavailablelocale
algorithm used by 9.2.3 LookupMatcher ( availableLocales, requestedLocales )
https://tc39.es/ecma402/#sec-lookupmatcher
The default for localeMatcher is "best fit" but not "lookup" for all Intl objects.
And for 9.2.4 BestFitMatcher ( availableLocales, requestedLocales )
https://tc39.es/ecma402/#sec-bestfitmatcher
It may not match "sr-Thai-RS" for "sr" and return ["de", "zh-CN"] instead. Therefore, we need to change this test to only test on {localeMatcher: "lookup"}
* Add option to getLocaleSupportInfo
Needed to test different localeMatcher
* only test for "lookup" localeMatcher
* Get the info based on the localeMatcher
* pass in localeMatcher to getLocaleSupportInfo
These tests support the following normative change
"Normative: Allow null or undefined in Reference Records"
https://github.com/tc39/ecma262/pull/2267
The tests concerning the `delete` operator increase coverage to verify
behavior which, though related, is not altered by the normative change.
These tests are intended to guard against regressions as engines
implement the new semantics.
* Add tests for Object.hasOwn
* Update test/built-ins/Object/hasOwn/length.js
Co-authored-by: Jordan Harband <ljharb@gmail.com>
* Update test/built-ins/Object/hasOwn/name.js
Co-authored-by: Jordan Harband <ljharb@gmail.com>
* Fixup comments for Object.hasOwn
* Add Object.hasOwn descriptor test
* use assert.sameValue with true instead of assert()
* remove extra semicolons
* Remove old $ERROR style tests from hasown
* Fix thrown error type in hasown tests
* Fix incorrect test cases
Co-authored-by: Jordan Harband <ljharb@gmail.com>