@next-core/cook 1.6.6 → 1.6.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,7 +3,7 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [1.6.6](https://github.com/easyops-cn/next-core/compare/@next-core/cook@1.6.5...@next-core/cook@1.6.6) (2021-12-30)
6
+ ## [1.6.10](https://github.com/easyops-cn/next-core/compare/@next-core/cook@1.6.9...@next-core/cook@1.6.10) (2022-01-28)
7
7
 
8
8
  **Note:** Version bump only for package @next-core/cook
9
9
 
@@ -11,38 +11,40 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
- ## [1.6.5](https://github.com/easyops-cn/next-core/compare/@next-core/cook@1.6.4...@next-core/cook@1.6.5) (2021-12-29)
15
-
16
- **Note:** Version bump only for package @next-core/cook
17
-
18
-
14
+ ## [1.6.9](https://github.com/easyops-cn/next-core/compare/@next-core/cook@1.6.8...@next-core/cook@1.6.9) (2022-01-13)
19
15
 
16
+ ### Bug Fixes
20
17
 
18
+ - perform iterator close in for-of-loop ([bd44f3f](https://github.com/easyops-cn/next-core/commit/bd44f3f2e3d3996b48b6af50cb97528aae631047))
21
19
 
22
- ## [1.6.4](https://github.com/easyops-cn/next-core/compare/@next-core/cook@1.6.3...@next-core/cook@1.6.4) (2021-12-24)
20
+ ## [1.6.8](https://github.com/easyops-cn/next-core/compare/@next-core/cook@1.6.7...@next-core/cook@1.6.8) (2022-01-07)
23
21
 
24
22
  **Note:** Version bump only for package @next-core/cook
25
23
 
24
+ ## [1.6.7](https://github.com/easyops-cn/next-core/compare/@next-core/cook@1.6.6...@next-core/cook@1.6.7) (2022-01-05)
26
25
 
26
+ **Note:** Version bump only for package @next-core/cook
27
27
 
28
+ ## [1.6.6](https://github.com/easyops-cn/next-core/compare/@next-core/cook@1.6.5...@next-core/cook@1.6.6) (2021-12-30)
28
29
 
30
+ **Note:** Version bump only for package @next-core/cook
29
31
 
30
- ## [1.6.3](https://github.com/easyops-cn/next-core/compare/@next-core/cook@1.6.2...@next-core/cook@1.6.3) (2021-12-23)
32
+ ## [1.6.5](https://github.com/easyops-cn/next-core/compare/@next-core/cook@1.6.4...@next-core/cook@1.6.5) (2021-12-29)
31
33
 
32
34
  **Note:** Version bump only for package @next-core/cook
33
35
 
36
+ ## [1.6.4](https://github.com/easyops-cn/next-core/compare/@next-core/cook@1.6.3...@next-core/cook@1.6.4) (2021-12-24)
34
37
 
38
+ **Note:** Version bump only for package @next-core/cook
35
39
 
40
+ ## [1.6.3](https://github.com/easyops-cn/next-core/compare/@next-core/cook@1.6.2...@next-core/cook@1.6.3) (2021-12-23)
36
41
 
42
+ **Note:** Version bump only for package @next-core/cook
37
43
 
38
44
  ## [1.6.2](https://github.com/easyops-cn/next-core/compare/@next-core/cook@1.6.1...@next-core/cook@1.6.2) (2021-12-17)
39
45
 
40
46
  **Note:** Version bump only for package @next-core/cook
41
47
 
42
-
43
-
44
-
45
-
46
48
  ## [1.6.1](https://github.com/easyops-cn/next-core/compare/@next-core/cook@1.6.0...@next-core/cook@1.6.1) (2021-12-03)
47
49
 
48
50
  **Note:** Version bump only for package @next-core/cook
package/dist/cjs/cook.js CHANGED
@@ -776,7 +776,19 @@ function cook(rootAst, codeSource, {
776
776
  getRunningContext().LexicalEnvironment = oldEnv;
777
777
 
778
778
  if (!(0, _contextFree.LoopContinues)(result)) {
779
- return (0, _contextFree.UpdateEmpty)(result, V);
779
+ const status = (0, _contextFree.UpdateEmpty)(result, V);
780
+
781
+ if (!(iterationKind === "enumerate" || iteratorRecord.return === undefined)) {
782
+ // Perform *IteratorClose*
783
+ // https://tc39.es/ecma262/#sec-iteratorclose
784
+ const innerResult = iteratorRecord.return();
785
+
786
+ if (!innerResult || !["object", "function"].includes(typeof innerResult)) {
787
+ throw new TypeError(`Iterator result is not an object`);
788
+ }
789
+ }
790
+
791
+ return status;
780
792
  }
781
793
 
782
794
  if (result.Value !== _ExecutionContext.Empty) {