diff options
author | Mike Pennisi <mike@mikepennisi.com> | 2015-07-15 18:45:38 -0400 |
---|---|---|
committer | Mike Pennisi <mike@mikepennisi.com> | 2015-07-16 13:05:17 -0400 |
commit | 5cb1ba27d3f14a4af24df42020f99a3a668ee8e2 (patch) | |
tree | 0f629bd3d95a5be16c10926c0daa73ec6c284f0c /test/built-ins/Array/from/get-iter-method-err.js | |
parent | 741b799286409d51be430a09a5ab8c6d783c4cce (diff) | |
download | qtdeclarative-testsuites-5cb1ba27d3f14a4af24df42020f99a3a668ee8e2.tar.gz |
Add tests for Array.from
Limit tests to behavior of method when invoked with an iterable.
Diffstat (limited to 'test/built-ins/Array/from/get-iter-method-err.js')
-rw-r--r-- | test/built-ins/Array/from/get-iter-method-err.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/built-ins/Array/from/get-iter-method-err.js b/test/built-ins/Array/from/get-iter-method-err.js new file mode 100644 index 000000000..745f10813 --- /dev/null +++ b/test/built-ins/Array/from/get-iter-method-err.js @@ -0,0 +1,22 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 22.1.2.1 +description: Error accessing items' `Symbol.iterator` attribute +info: > + [...] + 4. Let usingIterator be GetMethod(items, @@iterator). + 5. ReturnIfAbrupt(usingIterator). +features: [Symbol.iterator] +---*/ + +var items = {}; +Object.defineProperty(items, Symbol.iterator, { + get: function() { + throw new Test262Error(); + } +}); + +assert.throws(Test262Error, function() { + Array.from(items); +}); |