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

Improve RegExp.prototype[@@replace] coverage #2481

Merged
merged 13 commits into from
Mar 23, 2020

Conversation

shvaikalesh
Copy link
Member

@shvaikalesh shvaikalesh commented Jan 26, 2020

@shvaikalesh shvaikalesh force-pushed the regexp-prototype-symbol-replace branch from a90e2b8 to 447837e Compare February 11, 2020 15:09
features: [Symbol.replace]
---*/

var r = /./;
var coercibleValue = {
length: 4,
index: 0,
Copy link
Member Author

Choose a reason for hiding this comment

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

This test was failing on JSC because it doesn't coerce index properly.

},
0: '',
1: 'foo',
2: 'bar',
3: 'baz'
3: 'baz',
index: 0,
Copy link
Member Author

Choose a reason for hiding this comment

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

This test was failing on JSC because it doesn't coerce index properly.

throw new Test262Error('This method should not be invoked.');
},
},
index: 0,
Copy link
Member Author

Choose a reason for hiding this comment

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

This test was failing on JSC because it doesn't coerce index properly.

};
r.exec = function() {
return coercibleIndex;
};

assert.sameValue(r[Symbol.replace]('abcd', ''), 'ab');
var replacer = function(_matched, position) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This test was not failing on JSC even though it doesn't coerce index to integer.

@shvaikalesh shvaikalesh marked this pull request as ready for review February 11, 2020 15:32
@rwaldron
Copy link
Contributor

@shvaikalesh Thanks for the extra notes!

@shvaikalesh shvaikalesh force-pushed the regexp-prototype-symbol-replace branch from 447837e to 7a3b8f7 Compare March 23, 2020 17:58
@shvaikalesh
Copy link
Member Author

shvaikalesh commented Mar 23, 2020

index coercion was recently fixed in JSC, so I've rebased from master to see new CI results.

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.

2 participants