mirror of
https://github.com/tc39/test262.git
synced 2025-05-29 19:20:30 +02:00
[matchAll] pass a global regex (#2399)
- also, expect the right kind of error in `flags-undefined-throws.js` Fixes #2398
This commit is contained in:
parent
d49777de27
commit
59d1af9d2a
@ -28,6 +28,6 @@ Object.defineProperty(RegExp.prototype, 'flags', {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
assert.throws(Test262Error, function () {
|
assert.throws(TypeError, function () {
|
||||||
''.matchAll(/a/g);
|
''.matchAll(/a/g);
|
||||||
});
|
});
|
||||||
|
@ -13,7 +13,7 @@ info: |
|
|||||||
features: [Symbol.matchAll, String.prototype.matchAll]
|
features: [Symbol.matchAll, String.prototype.matchAll]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var regexp = /./;
|
var regexp = /./g;
|
||||||
Object.defineProperty(regexp, Symbol.matchAll, {
|
Object.defineProperty(regexp, Symbol.matchAll, {
|
||||||
get() {
|
get() {
|
||||||
throw new Test262Error();
|
throw new Test262Error();
|
||||||
|
@ -16,7 +16,7 @@ info: |
|
|||||||
features: [Symbol.matchAll, String.prototype.matchAll]
|
features: [Symbol.matchAll, String.prototype.matchAll]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var regexp = /./;
|
var regexp = /./g;
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
var arg;
|
var arg;
|
||||||
var obj = {};
|
var obj = {};
|
||||||
|
@ -11,7 +11,7 @@ info: |
|
|||||||
features: [Symbol.matchAll, String.prototype.matchAll]
|
features: [Symbol.matchAll, String.prototype.matchAll]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var regexp = /./;
|
var regexp = /./g;
|
||||||
regexp[Symbol.matchAll] = function() {
|
regexp[Symbol.matchAll] = function() {
|
||||||
throw new Test262Error();
|
throw new Test262Error();
|
||||||
};
|
};
|
||||||
|
@ -18,5 +18,5 @@ Object.defineProperty(RegExp.prototype, Symbol.matchAll, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
assert.throws(Test262Error, function() {
|
assert.throws(Test262Error, function() {
|
||||||
''.matchAll(/./);
|
''.matchAll(/./g);
|
||||||
});
|
});
|
||||||
|
@ -25,7 +25,7 @@ RegExp.prototype[Symbol.matchAll] = function() {
|
|||||||
return returnVal;
|
return returnVal;
|
||||||
};
|
};
|
||||||
|
|
||||||
var regexp = /./;
|
var regexp = /./g;
|
||||||
var str = '';
|
var str = '';
|
||||||
|
|
||||||
assert.sameValue(str.matchAll(regexp), returnVal);
|
assert.sameValue(str.matchAll(regexp), returnVal);
|
||||||
|
@ -18,5 +18,5 @@ RegExp.prototype[Symbol.matchAll] = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
assert.throws(Test262Error, function() {
|
assert.throws(Test262Error, function() {
|
||||||
''.matchAll(/./);
|
''.matchAll(/./g);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user