| // Copyright (C) 2016 the V8 project authors. All rights reserved. |
| // This code is governed by the BSD license found in the LICENSE file. |
| Behavior when the `this` value is not a module namespace exotic object |
| 1. Let N be the this value. |
| 2. If N is not a module namespace exotic object, throw a TypeError |
| features: [Symbol.iterator] |
| import * as ns from './this-val-not-ns.js'; |
| var iter = ns[Symbol.iterator]; |
| assert.sameValue(typeof iter, 'function'); |
| assert.throws(TypeError, function() { |
| assert.throws(TypeError, function() { |
| assert.throws(TypeError, function() { |
| }, 'Array exotic object'); |
| assert.throws(TypeError, function() { |
| assert.throws(TypeError, function() { |
| assert.throws(TypeError, function() { |
| iter.call('string literal'); |
| assert.throws(TypeError, function() { |
| iter.call(Symbol.iterator); |