Skip to content
Snippets Groups Projects
Commit e403eea3 authored by Leo Balter's avatar Leo Balter Committed by Rick Waldron
Browse files

Fix false positives

parent 7375dcb0
No related branches found
No related tags found
No related merge requests found
...@@ -10,9 +10,20 @@ description: Check that duplicate RegExp flags are disallowed ...@@ -10,9 +10,20 @@ description: Check that duplicate RegExp flags are disallowed
features: [regexp-dotall] features: [regexp-dotall]
---*/ ---*/
new RegExp("", "mig"); // single g will not throw SyntaxError
assert.throws(SyntaxError, () => new RegExp("", "migg"), "duplicate g"); assert.throws(SyntaxError, () => new RegExp("", "migg"), "duplicate g");
new RegExp("", "i"); // single i will not throw SyntaxError
assert.throws(SyntaxError, () => new RegExp("", "ii"), "duplicate i"); assert.throws(SyntaxError, () => new RegExp("", "ii"), "duplicate i");
new RegExp("", "m"); // single m will not throw SyntaxError
assert.throws(SyntaxError, () => new RegExp("", "mm"), "duplicate m"); assert.throws(SyntaxError, () => new RegExp("", "mm"), "duplicate m");
new RegExp("", "s"); // single s will not throw SyntaxError
assert.throws(SyntaxError, () => new RegExp("", "ss"), "duplicate s"); assert.throws(SyntaxError, () => new RegExp("", "ss"), "duplicate s");
new RegExp("", "u"); // single u will not throw SyntaxError
assert.throws(SyntaxError, () => new RegExp("", "uu"), "duplicate u"); assert.throws(SyntaxError, () => new RegExp("", "uu"), "duplicate u");
new RegExp("", "y"); // single y will not throw SyntaxError
assert.throws(SyntaxError, () => new RegExp("", "yy"), "duplicate y"); assert.throws(SyntaxError, () => new RegExp("", "yy"), "duplicate y");
...@@ -11,6 +11,8 @@ info: | ...@@ -11,6 +11,8 @@ info: |
features: [Symbol.matchAll, String.prototype.matchAll] features: [Symbol.matchAll, String.prototype.matchAll]
---*/ ---*/
assert.sameValue(typeof String.prototype.matchAll, "function");
var regexp = /./; var regexp = /./;
regexp[Symbol.matchAll] = true; regexp[Symbol.matchAll] = true;
......
...@@ -18,6 +18,8 @@ features: [Symbol.matchAll, String.prototype.matchAll] ...@@ -18,6 +18,8 @@ features: [Symbol.matchAll, String.prototype.matchAll]
includes: [compareArray.js, compareIterator.js, regExpUtils.js] includes: [compareArray.js, compareIterator.js, regExpUtils.js]
---*/ ---*/
assert.sameValue(typeof String.prototype.matchAll, "function");
delete RegExp.prototype[Symbol.matchAll]; delete RegExp.prototype[Symbol.matchAll];
var str = '/a/g*/b/g'; var str = '/a/g*/b/g';
......
...@@ -12,4 +12,6 @@ info: | ...@@ -12,4 +12,6 @@ info: |
features: [Intl.Segmenter] features: [Intl.Segmenter]
---*/ ---*/
assert.sameValue(typeof Intl.Segmenter, "function");
assert.throws(TypeError, function() { new Intl.Segmenter([], null) }) assert.throws(TypeError, function() { new Intl.Segmenter([], null) })
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment