diff options
Diffstat (limited to '')
-rw-r--r-- | js/src/tests/test262/built-ins/StringIteratorPrototype/next/next-missing-internal-slots.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/StringIteratorPrototype/next/next-missing-internal-slots.js b/js/src/tests/test262/built-ins/StringIteratorPrototype/next/next-missing-internal-slots.js new file mode 100644 index 0000000000..888cde7aa2 --- /dev/null +++ b/js/src/tests/test262/built-ins/StringIteratorPrototype/next/next-missing-internal-slots.js @@ -0,0 +1,24 @@ +// Copyright (C) 2014 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-properties-of-string-iterator-instances +description: > + If the `this` value does not have all of the internal slots of an String + Iterator Instance (21.1.5.3), throw a `TypeError` exception. +info: | + ... + If O does not have all of the internal slots of a String Iterator Instance (21.1.5.3), + throw a TypeError exception. + ... + +features: [Symbol.iterator] +---*/ + +var iterator = ''[Symbol.iterator](); +var object = Object.create(iterator); + +assert.throws(TypeError, function() { + object.next(); +}); + +reportCompare(0, 0); |