* Improve test coverage for `super` keyword
Add tests for SuperCall and SuperProperty, organized together in the
`test/language/expressions/super/` directory. For SuperProperty, include
tests for usage from within Object initializers and class bodies because
a different set of semantics are observable from each context.
The prior version of this test asserted only the property's
configurability. It was also limited to the RegExp object as returned
from the RegExp constructor.
Extend the test to verify all values of the property descriptor.
Duplicate these assertions in a separate file dedicated to the RegExp
object as created from a RegExp literal.
The previous commit removed two invalid tests designed to ensure that
the RegExpPrototype object is not itself a RegExp object. Introduce a
new test to assert this detail in a way that accounts for the
possibility of host extensions.
From ECMA262, section 16:
> Except as restricted in 16.2, an implementation may provide
> additional types, values, objects, properties, and functions beyond
> those described in this specification.
Section 16.2 makes no mention of the `lastIndex` property of the
%RegExpPrototype% intrinsic. It is therefor not a violation to define
%such an "own" property.
Remove the tests that assert otherwise.
A recent web-compatability change to ECMA262 modified the semantics of
the accessor methods on the %RegExpPrototype% intrinsic--the "get"
accessors now include steps dedicated to the case where the "this" value
is the %RegExpPrototype% object itself.
Remove the tests that have been invalidated by this change, introduce
tests asserting the new behavior, and extend coverage for other possible
"this" values.
The specification contains an explicit informative NOTE explaining that
the 'm' flag does not effect the behavior of the '^' assertion. Add a
test to verify this.
ES2015 reads:
> RegExpUnicodeEscapeSequence :: u{ HexDigits }
>
> - It is a Syntax Error if the MV of HexDigits > 1114111.
Use the MV 0x110000 to assert the lower boundary of values which are
expected to produce the SyntaxError.
Extend test for HTML comments
The V8 engine incorrectly requires a leading newline character for
MultiLineComments which contain the optional trailing HTMLCloseComment
[1]. Extend the current tests to fail when such an invalid restriction
is in place.
[1] https://bugs.chromium.org/p/v8/issues/detail?id=5142
A subtle aspect of the for-of iteration protocol concerns abrupt
completions that do *not* trigger iterator closing. Although this detail
is implicit in the current structure of the specification text, some
hosts may violate the protocol by closing the iterator because later
steps *do* specify that behavior.
The V8 engine is one such host--as of this writing, it incorrectly
closes the iterator when accessing the `value` property of the iterator
result produces an abrupt completion.
Add tests verifying that the iterator protocol is not violated in this
way for abrupt completions during the semantics of for-of evaluation.
ConversionError and RegExpError tests are methods that existed on
something that preceeded a IE9 Standard. They do not exist in the
specs, at least since ES5.
It's not test262 responsibility to maintain these tests as these
features can be freely implemented by any runtime.
The original implementation of the test for the absense of a
[[PromiseState]] internal slot did not actually assert the documented
semantics. Re-implement the test to rely on the IsPromise abstract
operation (via `Promise.prototype.then`) to accurately ensure that the
object does not have a [[PromiseState]] internal slot.
In relying on the semantics of the `instanceof` operator, the original
test for the [[Prototype]] internal slot was imprecise (the assertion
could be satisfied if additional objects were incorrectly defined on the
prototype chain). Re-write the test to assert the value of the
[[Prototype]] internal slot directly.