Fix false positives

This commit is contained in:
Leo Balter 2018-12-20 18:50:36 -02:00 committed by Rick Waldron
parent 7375dcb080
commit e403eea331
4 changed files with 17 additions and 0 deletions

View File

@ -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");

View File

@ -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;

View File

@ -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';

View File

@ -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) })