diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-constructor-throws.js')
-rw-r--r-- | js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-constructor-throws.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-constructor-throws.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-constructor-throws.js new file mode 100644 index 0000000000..73baa39d78 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-constructor-throws.js @@ -0,0 +1,34 @@ +// 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 thrown while accessing RegExp's constructor property +info: | + RegExp.prototype [ @@matchAll ] ( string ) + [...] + 3. Return ? MatchAllIterator(R, string). + + MatchAllIterator ( R, O ) + [...] + 2. If ? IsRegExp(R) is true, then + a. Let C be ? SpeciesConstructor(R, RegExp). + + SpeciesConstructor ( O, defaultConstructor ) + [...] + 2. Let C be ? Get(O, "constructor"). +features: [Symbol.matchAll] +---*/ + +var regexp = /./; +Object.defineProperty(regexp, 'constructor', { + get(){ + throw new Test262Error(); + } +}); + +assert.throws(Test262Error, function() { + regexp[Symbol.matchAll](''); +}); + +reportCompare(0, 0); |