Improve coverage for section 21: RegExp#711
Merged
Merged
Conversation
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.
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.
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.
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.
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.
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.
Member
|
cc @tcare |
Member
|
Looks good. No interference with tc39/ecma262#627 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changeset increases coverage for section 21, including addressing the
recent change to the specification reported in gh-677. It also improves test
structure.
Resolves gh-677.