main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
680 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | 'use strict';
|
---|
| 2 | // https://github.com/tc39/proposal-explicit-resource-management
|
---|
| 3 | var call = require('../internals/function-call');
|
---|
| 4 | var defineBuiltIn = require('../internals/define-built-in');
|
---|
| 5 | var getMethod = require('../internals/get-method');
|
---|
| 6 | var hasOwn = require('../internals/has-own-property');
|
---|
| 7 | var wellKnownSymbol = require('../internals/well-known-symbol');
|
---|
| 8 | var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;
|
---|
| 9 |
|
---|
| 10 | var DISPOSE = wellKnownSymbol('dispose');
|
---|
| 11 |
|
---|
| 12 | if (!hasOwn(IteratorPrototype, DISPOSE)) {
|
---|
| 13 | defineBuiltIn(IteratorPrototype, DISPOSE, function () {
|
---|
| 14 | var $return = getMethod(this, 'return');
|
---|
| 15 | if ($return) call($return, this);
|
---|
| 16 | });
|
---|
| 17 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.