mirror of
https://github.com/tc39/test262.git
synced 2025-07-25 15:04:43 +02:00
Fix false positives
This commit is contained in:
parent
7375dcb080
commit
e403eea331
@ -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: |
|
|||||||
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]
|
|||||||
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: |
|
|||||||
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) })
|
||||||
|
Loading…
x
Reference in New Issue
Block a user