diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/regexpcreate-this-throws.js')
-rw-r--r-- | js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/regexpcreate-this-throws.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/regexpcreate-this-throws.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/regexpcreate-this-throws.js new file mode 100644 index 0000000000..edb02b3b8c --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/regexpcreate-this-throws.js @@ -0,0 +1,32 @@ +// Copyright (C) 2018 Peter Wong. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: Re-throws errors while creating an internal RegExp +info: | + RegExp.prototype [ @@matchAll ] ( string ) + [...] + 3. Return ? MatchAllIterator(R, string). + + MatchAllIterator ( R, O ) + [...] + 2. If ? IsRegExp(R) is true, then + [...] + 3. Else, + a. Let flags be "g". + b. Let matcher be ? RegExpCreate(R, flags). +features: [Symbol.matchAll] +---*/ + +var obj = { + toString() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + RegExp.prototype[Symbol.matchAll].call(obj, ''); +}); + + +reportCompare(0, 0); |