aswi2020vldc-gitlab/templetes/node_modules/es-abstract/2017/CreateIterResultObject.js @ 4605a44b
1 |
'use strict'; |
---|---|
2 |
|
3 |
var GetIntrinsic = require('../GetIntrinsic'); |
4 |
|
5 |
var $TypeError = GetIntrinsic('%TypeError%'); |
6 |
|
7 |
var Type = require('./Type'); |
8 |
|
9 |
// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject
|
10 |
|
11 |
module.exports = function CreateIterResultObject(value, done) { |
12 |
if (Type(done) !== 'Boolean') { |
13 |
throw new $TypeError('Assertion failed: Type(done) is not Boolean'); |
14 |
}
|
15 |
return { |
16 |
value: value, |
17 |
done: done |
18 |
};
|
19 |
};
|