diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/get-global-err.js')
-rw-r--r-- | js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/get-global-err.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/get-global-err.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/get-global-err.js new file mode 100644 index 0000000000..22690b007f --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/get-global-err.js @@ -0,0 +1,30 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Behavior when error is thrown during retrieval of `global` property +esid: sec-regexp.prototype-@@match +info: | + 1. Let _rx_ be the *this* value. + 2. If Type(_rx_) is not Object, throw a *TypeError* exception. + 3. Let _S_ be ? ToString(_string_). + 4. Let _flags_ be ? ToString(? Get(_rx_, *"flags"*)). + + sec-get-regexp.prototype.flags get RegExp.prototype.flags + 6. Let _global_ be ToBoolean(? Get(_R_, *"global"*)). +features: [Symbol.match] +---*/ + +var re = /./; +Object.defineProperty(re, 'global', { + get() { + throw new Test262Error(); + } +}); + +assert.throws(Test262Error, function() { + RegExp.prototype[Symbol.match].call(re); +}); + +reportCompare(0, 0); |