Skip to content

Improve coverage for section 21: RegExp#711

Merged
tcare merged 7 commits into
tc39:masterfrom
bocoup:audit2016-section-21-regexp
Aug 4, 2016
Merged

Improve coverage for section 21: RegExp#711
tcare merged 7 commits into
tc39:masterfrom
bocoup:audit2016-section-21-regexp

Conversation

@jugglinmike

Copy link
Copy Markdown
Contributor

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.

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.
@littledan

Copy link
Copy Markdown
Member

cc @tcare

@tcare

tcare commented Aug 4, 2016

Copy link
Copy Markdown
Member

Looks good. No interference with tc39/ecma262#627

@tcare tcare merged commit 8a6d7a4 into tc39:master Aug 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants