@next-core/cook 1.6.8 → 1.6.12

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.8](https://github.com/easyops-cn/next-core/compare/@next-core/cook@1.6.7...@next-core/cook@1.6.8) (2022-01-07)
6
+ ## [1.6.12](https://github.com/easyops-cn/next-core/compare/@next-core/cook@1.6.11...@next-core/cook@1.6.12) (2022-02-17)
7
7
 
8
8
  **Note:** Version bump only for package @next-core/cook
9
9
 
@@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
- ## [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)
14
+ ## [1.6.11](https://github.com/easyops-cn/next-core/compare/@next-core/cook@1.6.10...@next-core/cook@1.6.11) (2022-02-14)
15
15
 
16
16
  **Note:** Version bump only for package @next-core/cook
17
17
 
@@ -19,7 +19,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
19
19
 
20
20
 
21
21
 
22
- ## [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)
22
+ ## [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)
23
23
 
24
24
  **Note:** Version bump only for package @next-core/cook
25
25
 
@@ -27,38 +27,40 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
27
27
 
28
28
 
29
29
 
30
- ## [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
-
32
- **Note:** Version bump only for package @next-core/cook
33
-
34
-
30
+ ## [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)
35
31
 
32
+ ### Bug Fixes
36
33
 
34
+ - perform iterator close in for-of-loop ([bd44f3f](https://github.com/easyops-cn/next-core/commit/bd44f3f2e3d3996b48b6af50cb97528aae631047))
37
35
 
38
- ## [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)
36
+ ## [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)
39
37
 
40
38
  **Note:** Version bump only for package @next-core/cook
41
39
 
40
+ ## [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)
42
41
 
42
+ **Note:** Version bump only for package @next-core/cook
43
43
 
44
+ ## [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)
44
45
 
46
+ **Note:** Version bump only for package @next-core/cook
45
47
 
46
- ## [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)
48
+ ## [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)
47
49
 
48
50
  **Note:** Version bump only for package @next-core/cook
49
51
 
52
+ ## [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)
50
53
 
54
+ **Note:** Version bump only for package @next-core/cook
51
55
 
56
+ ## [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)
52
57
 
58
+ **Note:** Version bump only for package @next-core/cook
53
59
 
54
60
  ## [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)
55
61
 
56
62
  **Note:** Version bump only for package @next-core/cook
57
63
 
58
-
59
-
60
-
61
-
62
64
  ## [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)
63
65
 
64
66
  **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) {