diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring-throws.js')
-rw-r--r-- | js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring-throws.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring-throws.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring-throws.js new file mode 100644 index 0000000000..6592addd96 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring-throws.js @@ -0,0 +1,29 @@ +// Copyright (C) 2018 Jordan Harband. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: String coercion of string parameter +info: | + RegExp.prototype [ @@matchAll ] ( string ) + [...] + 3. Return ? MatchAllIterator(R, string). + + MatchAllIterator ( R, O ) + 1. Let S be ? ToString(O). +features: [Symbol.matchAll] +---*/ + +var obj = { + valueOf() { + throw new Test262Error('This method should not be invoked.'); + }, + toString() { + throw new Test262Error('toString invoked'); + } +}; + +assert.throws(Test262Error, function() { + /toString value/[Symbol.matchAll](obj); +}); + +reportCompare(0, 0); |