Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement step 5 in RegExp constructor #3305

Merged
merged 1 commit into from
Sep 25, 2023
Merged

Implement step 5 in RegExp constructor #3305

merged 1 commit into from
Sep 25, 2023

Conversation

HalidOdat
Copy link
Member

@HalidOdat HalidOdat commented Sep 25, 2023

The following step was missing from our implementation, which caused some test262 test to fail.

5. Else if patternIsRegExp is true, then
    a. Let P be ? Get(pattern, "source").
    b. If flags is undefined, then
        i. Let F be ? Get(pattern, "flags").
    c. Else,
        i. Let F be flags.

@HalidOdat HalidOdat added enhancement New feature or request builtins PRs and Issues related to builtins/intrinsics labels Sep 25, 2023
@HalidOdat HalidOdat added this to the v0.18.0 milestone Sep 25, 2023
@HalidOdat HalidOdat requested a review from a team September 25, 2023 15:29
@HalidOdat HalidOdat changed the title Implement step 5 in RegExp constructor Implement step 5 in RegExp constructor Sep 25, 2023
The following step was missing from our `RegExp` constructor implementation:

```
5. Else if patternIsRegExp is true, then
    a. Let P be ? Get(pattern, "source").
    b. If flags is undefined, then
        i. Let F be ? Get(pattern, "flags").
    c. Else,
        i. Let F be flags.
```
@HalidOdat HalidOdat force-pushed the fix/regexp-constructor branch from 0b15e91 to 7884ed3 Compare September 25, 2023 15:34
@github-actions
Copy link

Test262 conformance changes

Test result main count PR count difference
Total 95,574 95,574 0
Passed 75,156 75,164 +8
Ignored 19,494 19,494 0
Failed 924 916 -8
Panics 0 0 0
Conformance 78.64% 78.64% +0.01%
Fixed tests (8):
test/built-ins/RegExp/from-regexp-like-flag-override.js [strict mode] (previously Failed)
test/built-ins/RegExp/from-regexp-like-flag-override.js (previously Failed)
test/built-ins/RegExp/from-regexp-like-get-source-err.js [strict mode] (previously Failed)
test/built-ins/RegExp/from-regexp-like-get-source-err.js (previously Failed)
test/built-ins/RegExp/from-regexp-like.js [strict mode] (previously Failed)
test/built-ins/RegExp/from-regexp-like.js (previously Failed)
test/built-ins/RegExp/from-regexp-like-get-flags-err.js [strict mode] (previously Failed)
test/built-ins/RegExp/from-regexp-like-get-flags-err.js (previously Failed)

@codecov
Copy link

codecov bot commented Sep 25, 2023

Codecov Report

Patch coverage: 64.28% and project coverage change: -0.01% ⚠️

Comparison is base (25c120b) 49.80% compared to head (7884ed3) 49.80%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3305      +/-   ##
==========================================
- Coverage   49.80%   49.80%   -0.01%     
==========================================
  Files         441      441              
  Lines       43078    43083       +5     
==========================================
+ Hits        21456    21457       +1     
- Misses      21622    21626       +4     
Files Changed Coverage Δ
boa_engine/src/builtins/regexp/mod.rs 61.91% <64.28%> (-0.53%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@raskad raskad added this pull request to the merge queue Sep 25, 2023
Merged via the queue into main with commit 1b03f83 Sep 25, 2023
@HalidOdat HalidOdat deleted the fix/regexp-constructor branch September 25, 2023 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builtins PRs and Issues related to builtins/intrinsics enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants